diff options
Diffstat (limited to 'kexi/plugins/queries/kexiquerydesignerguieditor.cpp')
-rw-r--r-- | kexi/plugins/queries/kexiquerydesignerguieditor.cpp | 446 |
1 files changed, 223 insertions, 223 deletions
diff --git a/kexi/plugins/queries/kexiquerydesignerguieditor.cpp b/kexi/plugins/queries/kexiquerydesignerguieditor.cpp index d67573e8..a6205222 100644 --- a/kexi/plugins/queries/kexiquerydesignerguieditor.cpp +++ b/kexi/plugins/queries/kexiquerydesignerguieditor.cpp @@ -20,10 +20,10 @@ #include "kexiquerydesignerguieditor.h" -#include <qlayout.h> -#include <qpainter.h> -#include <qdom.h> -#include <qregexp.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqdom.h> +#include <tqregexp.h> #include <kdebug.h> #include <klocale.h> @@ -56,14 +56,14 @@ #include "kexiquerypart.h" -//! @todo remove KEXI_NO_QUERY_TOTALS later -#define KEXI_NO_QUERY_TOTALS +//! @todo remove KEXI_NO_TQUERY_TOTALS later +#define KEXI_NO_TQUERY_TOTALS //! indices for table columns #define COLUMN_ID_COLUMN 0 #define COLUMN_ID_TABLE 1 #define COLUMN_ID_VISIBLE 2 -#ifdef KEXI_NO_QUERY_TOTALS +#ifdef KEXI_NO_TQUERY_TOTALS # define COLUMN_ID_SORTING 3 # define COLUMN_ID_CRITERIA 4 #else @@ -84,7 +84,7 @@ public: } bool changeSingleCellValue(KexiTableItem &item, int columnNumber, - const QVariant& value, KexiDB::ResultInfo* result) + const TQVariant& value, KexiDB::ResultInfo* result) { data->clearRowEditBuffer(); if (!data->updateRowEditBuffer(&item, columnNumber, value) @@ -99,11 +99,11 @@ public: KexiTableViewData *data; KexiDataTable *dataTable; - QGuardedPtr<KexiDB::Connection> conn; + TQGuardedPtr<KexiDB::Connection> conn; KexiRelationWidget *relations; KexiSectionHeader *head; - QSplitter *spl; + TQSplitter *spl; /*! Used to remember in slotDroppedAtRow() what data was dropped, so we can create appropriate prop. set in slotRowInserted() @@ -116,46 +116,46 @@ public: This information is cached and entirely refreshed on updateColumnsData(). The dict is filled with (char*)1 values (doesn't matter what it is); */ - QDict<char> fieldColumnIdentifiers; + TQDict<char> fieldColumnIdentifiers; KexiDataAwarePropertySet* sets; KexiTableItem *droppedNewItem; - QString droppedNewTable, droppedNewField; + TQString droppedNewTable, droppedNewField; bool slotTableAdded_enabled : 1; }; -static bool isAsterisk(const QString& tableName, const QString& fieldName) +static bool isAsterisk(const TQString& tableName, const TQString& fieldName) { return tableName=="*" || fieldName.endsWith("*"); } //! @internal \return true if sorting is allowed for \a fieldName and \a tableName -static bool sortingAllowed(const QString& fieldName, const QString& tableName) { +static bool sortingAllowed(const TQString& fieldName, const TQString& tableName) { return ! (fieldName=="*" || (fieldName.isEmpty() && tableName=="*")); } //========================================================= KexiQueryDesignerGuiEditor::KexiQueryDesignerGuiEditor( - KexiMainWindow *mainWin, QWidget *parent, const char *name) - : KexiViewBase(mainWin, parent, name) + KexiMainWindow *mainWin, TQWidget *tqparent, const char *name) + : KexiViewBase(mainWin, tqparent, name) , d( new Private() ) { d->conn = mainWin->project()->dbConnection(); - d->spl = new QSplitter(Vertical, this); + d->spl = new TQSplitter(Qt::Vertical, this); d->spl->setChildrenCollapsible(false); d->relations = new KexiRelationWidget(mainWin, d->spl, "relations"); - connect(d->relations, SIGNAL(tableAdded(KexiDB::TableSchema&)), - this, SLOT(slotTableAdded(KexiDB::TableSchema&))); - connect(d->relations, SIGNAL(tableHidden(KexiDB::TableSchema&)), - this, SLOT(slotTableHidden(KexiDB::TableSchema&))); - connect(d->relations, SIGNAL(tableFieldDoubleClicked(KexiDB::TableSchema*,const QString&)), - this, SLOT(slotTableFieldDoubleClicked(KexiDB::TableSchema*,const QString&))); - - d->head = new KexiSectionHeader(i18n("Query Columns"), Vertical, d->spl); + connect(d->relations, TQT_SIGNAL(tableAdded(KexiDB::TableSchema&)), + this, TQT_SLOT(slotTableAdded(KexiDB::TableSchema&))); + connect(d->relations, TQT_SIGNAL(tableHidden(KexiDB::TableSchema&)), + this, TQT_SLOT(slotTableHidden(KexiDB::TableSchema&))); + connect(d->relations, TQT_SIGNAL(tableFieldDoubleClicked(KexiDB::TableSchema*,const TQString&)), + this, TQT_SLOT(slotTableFieldDoubleClicked(KexiDB::TableSchema*,const TQString&))); + + d->head = new KexiSectionHeader(i18n("Query Columns"),Qt::Vertical, d->spl); d->dataTable = new KexiDataTable(mainWin, d->head, "guieditor_dataTable", false); d->dataTable->dataAwareObject()->setSpreadSheetMode(); @@ -164,39 +164,39 @@ KexiQueryDesignerGuiEditor::KexiQueryDesignerGuiEditor( initTableColumns(); initTableRows(); - QValueList<int> c; + TQValueList<int> c; c << COLUMN_ID_COLUMN << COLUMN_ID_TABLE << COLUMN_ID_CRITERIA; if (d->dataTable->tableView()/*sanity*/) { d->dataTable->tableView()->adjustColumnWidthToContents(COLUMN_ID_VISIBLE); d->dataTable->tableView()->adjustColumnWidthToContents(COLUMN_ID_SORTING); d->dataTable->tableView()->maximizeColumnsWidth( c ); d->dataTable->tableView()->setDropsAtRowEnabled(true); - connect(d->dataTable->tableView(), SIGNAL(dragOverRow(KexiTableItem*,int,QDragMoveEvent*)), - this, SLOT(slotDragOverTableRow(KexiTableItem*,int,QDragMoveEvent*))); - connect(d->dataTable->tableView(), SIGNAL(droppedAtRow(KexiTableItem*,int,QDropEvent*,KexiTableItem*&)), - this, SLOT(slotDroppedAtRow(KexiTableItem*,int,QDropEvent*,KexiTableItem*&))); - connect(d->dataTable->tableView(), SIGNAL(newItemAppendedForAfterDeletingInSpreadSheetMode()), - this, SLOT(slotNewItemAppendedForAfterDeletingInSpreadSheetMode())); + connect(d->dataTable->tableView(), TQT_SIGNAL(dragOverRow(KexiTableItem*,int,TQDragMoveEvent*)), + this, TQT_SLOT(slotDragOverTableRow(KexiTableItem*,int,TQDragMoveEvent*))); + connect(d->dataTable->tableView(), TQT_SIGNAL(droppedAtRow(KexiTableItem*,int,TQDropEvent*,KexiTableItem*&)), + this, TQT_SLOT(slotDroppedAtRow(KexiTableItem*,int,TQDropEvent*,KexiTableItem*&))); + connect(d->dataTable->tableView(), TQT_SIGNAL(newItemAppendedForAfterDeletingInSpreadSheetMode()), + this, TQT_SLOT(slotNewItemAppendedForAfterDeletingInSpreadSheetMode())); } - connect(d->data, SIGNAL(aboutToChangeCell(KexiTableItem*,int,QVariant&,KexiDB::ResultInfo*)), - this, SLOT(slotBeforeCellChanged(KexiTableItem*,int,QVariant&,KexiDB::ResultInfo*))); - connect(d->data, SIGNAL(rowInserted(KexiTableItem*,uint,bool)), - this, SLOT(slotRowInserted(KexiTableItem*,uint,bool))); - connect(d->relations, SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*)), - this, SLOT(slotTablePositionChanged(KexiRelationViewTableContainer*))); - connect(d->relations, SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*)), - this, SLOT(slotAboutConnectionRemove(KexiRelationViewConnection*))); - - QVBoxLayout *l = new QVBoxLayout(this); + connect(d->data, TQT_SIGNAL(aboutToChangeCell(KexiTableItem*,int,TQVariant&,KexiDB::ResultInfo*)), + this, TQT_SLOT(slotBeforeCellChanged(KexiTableItem*,int,TQVariant&,KexiDB::ResultInfo*))); + connect(d->data, TQT_SIGNAL(rowInserted(KexiTableItem*,uint,bool)), + this, TQT_SLOT(slotRowInserted(KexiTableItem*,uint,bool))); + connect(d->relations, TQT_SIGNAL(tablePositionChanged(KexiRelationViewTableContainer*)), + this, TQT_SLOT(slotTablePositionChanged(KexiRelationViewTableContainer*))); + connect(d->relations, TQT_SIGNAL(aboutConnectionRemove(KexiRelationViewConnection*)), + this, TQT_SLOT(slotAboutConnectionRemove(KexiRelationViewConnection*))); + + TQVBoxLayout *l = new TQVBoxLayout(this); l->addWidget(d->spl); addChildView(d->relations); addChildView(d->dataTable); setViewWidget(d->dataTable, true); - d->relations->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); - d->head->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); + d->relations->tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding); + d->head->tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Expanding); updateGeometry(); - d->spl->setSizes(QValueList<int>()<< 800<<400); + d->spl->setSizes(TQValueList<int>()<< 800<<400); } KexiQueryDesignerGuiEditor::~KexiQueryDesignerGuiEditor() @@ -222,14 +222,14 @@ KexiQueryDesignerGuiEditor::initTableColumns() KexiTableViewColumn *col3 = new KexiTableViewColumn("visible", KexiDB::Field::Boolean, i18n("Visible"), i18n("Describes visibility for a given field or expression.")); - col3->field()->setDefaultValue( QVariant(false, 0) ); + col3->field()->setDefaultValue( TQVariant(false, 0) ); col3->field()->setNotNull( true ); d->data->addColumn(col3); -#ifndef KEXI_NO_QUERY_TOTALS +#ifndef KEXI_NO_TQUERY_TOTALS KexiTableViewColumn *col4 = new KexiTableViewColumn("totals", KexiDB::Field::Enum, i18n("Totals"), i18n("Describes a way of computing totals for a given field or expression.")); - QValueVector<QString> totalsTypes; + TQValueVector<TQString> totalsTypes; totalsTypes.append( i18n("Group by") ); totalsTypes.append( i18n("Sum") ); totalsTypes.append( i18n("Average") ); @@ -242,7 +242,7 @@ KexiQueryDesignerGuiEditor::initTableColumns() KexiTableViewColumn *col5 = new KexiTableViewColumn("sort", KexiDB::Field::Enum, i18n("Sorting"), i18n("Describes a way of sorting for a given field.")); - QValueVector<QString> sortTypes; + TQValueVector<TQString> sortTypes; sortTypes.append( "" ); sortTypes.append( i18n("Ascending") ); sortTypes.append( i18n("Descending") ); @@ -264,7 +264,7 @@ void KexiQueryDesignerGuiEditor::initTableRows() for (int i=0; i<(int)d->sets->size(); i++) { KexiTableItem* item; d->data->append(item = d->data->createItem()); - item->at(COLUMN_ID_VISIBLE) = QVariant(false, 0); + item->at(COLUMN_ID_VISIBLE) = TQVariant(false, 0); } d->dataTable->dataAwareObject()->setData(d->data); @@ -275,22 +275,22 @@ void KexiQueryDesignerGuiEditor::updateColumnsData() { d->dataTable->dataAwareObject()->acceptRowEdit(); - QStringList sortedTableNames; + TQStringList sortedTableNames; for (TablesDictIterator it(*d->relations->tables());it.current();++it) sortedTableNames += it.current()->schema()->name(); qHeapSort( sortedTableNames ); //several tables can be hidden now, so remove rows for these tables - QValueList<int> rowsToDelete; + TQValueList<int> rowsToDelete; for (int r = 0; r<(int)d->sets->size(); r++) { KoProperty::Set *set = d->sets->at(r); if (set) { - QString tableName = (*set)["table"].value().toString(); - QString fieldName = (*set)["field"].value().toString(); + TQString tableName = (*set)["table"].value().toString(); + TQString fieldName = (*set)["field"].value().toString(); const bool allTablesAsterisk = tableName=="*" && d->relations->tables()->isEmpty(); const bool fieldNotFound = tableName!="*" && !(*set)["isExpression"].value().toBool() - && sortedTableNames.end() == qFind( sortedTableNames.begin(), sortedTableNames.end(), tableName ); + && sortedTableNames.end() == tqFind( sortedTableNames.begin(), sortedTableNames.end(), tableName ); if (allTablesAsterisk || fieldNotFound) { //table not found: mark this line for later removal @@ -313,12 +313,12 @@ void KexiQueryDesignerGuiEditor::updateColumnsData() // tempData()->clearQuery(); tempData()->unregisterForTablesSchemaChanges(); - for (QStringList::const_iterator it = sortedTableNames.constBegin(); + for (TQStringList::const_iterator it = sortedTableNames.constBegin(); it!=sortedTableNames.constEnd(); ++it) { //table /*! @todo what about query? */ - KexiDB::TableSchema *table = d->relations->tables()->find(*it)->schema()->table(); + KexiDB::TableSchema *table = d->relations->tables()->tqfind(*it)->schema()->table(); d->conn->registerForTableSchemaChanges(*tempData(), *table); //this table will be used item = d->tablesColumnData->createItem(); //new KexiTableItem(2); (*item)[COLUMN_ID_COLUMN]=table->name(); @@ -333,7 +333,7 @@ void KexiQueryDesignerGuiEditor::updateColumnsData() for (KexiDB::Field::ListIterator t_it = table->fieldsIterator();t_it.current();++t_it) { item = d->fieldColumnData->createItem(); // new KexiTableItem(2); (*item)[COLUMN_ID_COLUMN]=table->name()+"."+t_it.current()->name(); - (*item)[COLUMN_ID_TABLE]=QString(" ") + t_it.current()->name(); + (*item)[COLUMN_ID_TABLE]=TQString(" ") + t_it.current()->name(); d->fieldColumnData->append( item ); d->fieldColumnIdentifiers.insert((*item)[COLUMN_ID_COLUMN].toString(), (char*)1); //cache } @@ -349,16 +349,16 @@ KexiRelationWidget *KexiQueryDesignerGuiEditor::relationView() const KexiQueryPart::TempData * KexiQueryDesignerGuiEditor::tempData() const { - return static_cast<KexiQueryPart::TempData*>(parentDialog()->tempData()); + return static_cast<KexiQueryPart::TempData*>(tqparentDialog()->tempData()); } -static QString msgCannotSwitch_EmptyDesign() { +static TQString msgCannotSwitch_EmptyDesign() { return i18n("Cannot switch to data view, because query design is empty.\n" "First, please create your design."); } bool -KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg) +KexiQueryDesignerGuiEditor::buildSchema(TQString *errMsg) { //build query schema KexiQueryPart::TempData * temp = tempData(); @@ -378,7 +378,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg) // -WHERE expression // -ORDER BY list KexiDB::BaseExpr *whereExpr = 0; - const uint count = QMIN(d->data->count(), d->sets->size()); + const uint count = TQMIN(d->data->count(), d->sets->size()); bool fieldsFound = false; KexiTableViewData::Iterator it(d->data->iterator()); for (uint i=0; i<count && it.current(); ++it, i++) { @@ -388,29 +388,29 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg) d->dataTable->dataAwareObject()->setCursorPosition(i,0); if (errMsg) *errMsg = i18n("Select column for table \"%1\"") - .arg(it.current()->at(COLUMN_ID_TABLE).toString()); + .tqarg(it.current()->at(COLUMN_ID_TABLE).toString()); return false; } KoProperty::Set *set = d->sets->at(i); if (set) { - QString tableName = (*set)["table"].value().toString().stripWhiteSpace(); - QString fieldName = (*set)["field"].value().toString(); - QString fieldAndTableName = fieldName; + TQString tableName = (*set)["table"].value().toString().stripWhiteSpace(); + TQString fieldName = (*set)["field"].value().toString(); + TQString fieldAndTableName = fieldName; KexiDB::Field *currentField = 0; // will be set if this column is a single field KexiDB::QueryColumnInfo* currentColumn = 0; if (!tableName.isEmpty()) fieldAndTableName.prepend(tableName+"."); const bool fieldVisible = (*set)["visible"].value().toBool(); - QString criteriaStr = (*set)["criteria"].value().toString(); - QCString alias = (*set)["alias"].value().toCString(); + TQString criteriaStr = (*set)["criteria"].value().toString(); + TQCString alias = (*set)["alias"].value().toCString(); if (!criteriaStr.isEmpty()) { int token; KexiDB::BaseExpr *criteriaExpr = parseExpressionString(criteriaStr, token, true/*allowRelationalOperator*/); if (!criteriaExpr) {//for sanity if (errMsg) - *errMsg = i18n("Invalid criteria \"%1\"").arg(criteriaStr); + *errMsg = i18n("Invalid criteria \"%1\"").tqarg(criteriaStr); delete whereExpr; return false; } @@ -431,7 +431,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg) false/*!allowRelationalOperator*/); if (!columnExpr) { if (errMsg) - *errMsg = i18n("Invalid expression \"%1\"").arg(fieldName); + *errMsg = i18n("Invalid expression \"%1\"").tqarg(fieldName); return false; } temp->query()->addExpression(columnExpr, fieldVisible); @@ -523,7 +523,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg) fieldNumber++; KexiDB::Field *currentField = 0; KexiDB::QueryColumnInfo *currentColumn = 0; - QString sortingString( (*set)["sorting"].value().toString() ); + TQString sortingString( (*set)["sorting"].value().toString() ); if (sortingString!="ascending" && sortingString!="descending") continue; if (!(*set)["visible"].value().toBool()) { @@ -547,7 +547,7 @@ KexiQueryDesignerGuiEditor::buildSchema(QString *errMsg) //! @todo support expressions here continue; //! @todo ok, but not for expressions - QString aliasString( (*set)["alias"].value().toString() ); + TQString aliasString( (*set)["alias"].value().toString() ); currentColumn = temp->query()->columnInfo( (*set)["table"].value().toString() + "." + (aliasString.isEmpty() ? currentField->name() : aliasString) ); @@ -581,14 +581,14 @@ KexiQueryDesignerGuiEditor::beforeSwitchTo(int mode, bool &dontStore) // if (!d->dataTable->dataAwareObject()->acceptRowEdit()) // return cancelled; - if (!dirty() && parentDialog()->neverSaved()) { + if (!dirty() && tqparentDialog()->neverSaved()) { KMessageBox::information(this, msgCannotSwitch_EmptyDesign()); return cancelled; } if (dirty() || !tempData()->query()) { //remember current design in a temporary structure dontStore=true; - QString errMsg; + TQString errMsg; //build schema; problems are not allowed if (!buildSchema(&errMsg)) { KMessageBox::sorry(this, errMsg); @@ -618,13 +618,13 @@ tristate KexiQueryDesignerGuiEditor::afterSwitchFrom(int mode) { const bool was_dirty = dirty(); - KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection(); + KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection(); if (mode==Kexi::NoViewMode || (mode==Kexi::DataViewMode && !tempData()->query())) { //this is not a SWITCH but a fresh opening in this view mode if (!m_dialog->neverSaved()) { if (!loadLayout()) { //err msg - parentDialog()->setStatus(conn, + tqparentDialog()->settqStatus(conn, i18n("Query definition loading failed."), i18n("Query design may be corrupted so it could not be opened even in text view.\n" "You can delete the query and create it again.")); @@ -633,13 +633,13 @@ KexiQueryDesignerGuiEditor::afterSwitchFrom(int mode) // Invalid queries case: // KexiDialogBase::switchToViewMode() first opens DesignViewMode, // and then KexiQueryPart::loadSchemaData() doesn't allocate QuerySchema object - // do we're carefully looking at parentDialog()->schemaData() - KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(parentDialog()->schemaData()); + // do we're carefully looking at tqparentDialog()->schemaData() + KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(tqparentDialog()->schemaData()); if (q) { KexiDB::ResultInfo result; showFieldsForQuery( q, result ); if (!result.success) { - parentDialog()->setStatus(&result, i18n("Query definition loading failed.")); + tqparentDialog()->settqStatus(&result, i18n("Query definition loading failed.")); tempData()->proposeOpeningInTextViewModeBecauseOfProblems = true; return false; } @@ -662,7 +662,7 @@ KexiQueryDesignerGuiEditor::afterSwitchFrom(int mode) KexiDB::ResultInfo result; showFieldsAndRelationsForQuery( tempData()->query(), result ); if (!result.success) { - parentDialog()->setStatus(&result, i18n("Query definition loading failed.")); + tqparentDialog()->settqStatus(&result, i18n("Query definition loading failed.")); return false; } } @@ -698,7 +698,7 @@ KexiQueryDesignerGuiEditor::storeNewData(const KexiDB::SchemaData& sdata, bool & cancel = true; return 0; } - QString errMsg; + TQString errMsg; KexiQueryPart::TempData * temp = tempData(); if (!temp->query() || !(viewMode()==Kexi::DesignViewMode && !temp->queryChangedInPreviousView)) { //only rebuild schema if it has not been rebuilt previously @@ -809,11 +809,11 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( //2. Collect information about criterias // --this must be top level chain of AND's // --this will also show joins as: [table1.]field1 = [table2.]field2 - QDict<KexiDB::BaseExpr> criterias(101, false); + TQDict<KexiDB::BaseExpr> criterias(101, false); KexiDB::BaseExpr* e = query->whereExpression(); KexiDB::BaseExpr* eItem = 0; while (e) { - //eat parentheses because the expression can be (....) AND (... AND ... ) + //eat tqparentheses because the expression can be (....) AND (... AND ... ) while (e && e->toUnary() && e->token()=='(') e = e->toUnary()->arg(); @@ -826,7 +826,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( e = 0; } - //eat parentheses + //eat tqparentheses while (eItem && eItem->toUnary() && eItem->token()=='(') eItem = eItem->toUnary()->arg(); @@ -877,14 +877,14 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( //3. show fields (including * and table.*) uint row_num = 0; KexiDB::Field *field; - QPtrDict<char> usedCriterias(101); // <-- used criterias will be saved here + TQPtrDict<char> usedCriterias(101); // <-- used criterias will be saved here // so in step 4. we will be able to add // remaining invisible columns with criterias for (KexiDB::Field::ListIterator it(*query->fields()); (field = it.current()); ++it, row_num++) { //append a new row - QString tableName, fieldName, columnAlias, criteriaString; + TQString tableName, fieldName, columnAlias, criteriaString; KexiDB::BinaryExpr *criteriaExpr = 0; KexiDB::BaseExpr *criteriaArgument = 0; if (field->isQueryAsterisk()) { @@ -901,7 +901,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( columnAlias = query->columnAlias(row_num); if (field->isExpression()) { // if (columnAlias.isEmpty()) { -// columnAlias = i18n("expression", "expr%1").arg(row_num); //TODO +// columnAlias = i18n("expression", "expr%1").tqarg(row_num); //TODO // } // if (columnAlias.isEmpty()) //TODO: ok? perhaps do not allow to omit aliases? @@ -916,8 +916,8 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( if (!criteriaArgument) {//try table.field criteriaArgument = criterias[tableName+"."+fieldName]; } - if (criteriaArgument) {//criteria expression is just a parent of argument - criteriaExpr = criteriaArgument->parent()->toBinary(); + if (criteriaArgument) {//criteria expression is just a tqparent of argument + criteriaExpr = criteriaArgument->tqparent()->toBinary(); usedCriterias.insert(criteriaArgument, (char*)1); //save info. about used criteria } } @@ -942,7 +942,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( if (field->isExpression()) { // (*newItem)[COLUMN_ID_COLUMN] = ; if (!d->changeSingleCellValue(*newItem, COLUMN_ID_COLUMN, - QVariant(columnAlias + ": " + field->expression()->toString()), &result)) + TQVariant(columnAlias + ": " + field->expression()->toString()), &result)) return; //problems with setting column expression } } @@ -950,7 +950,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( //4. show ORDER BY information d->data->clearRowEditBuffer(); KexiDB::OrderByColumnList &orderByColumns = query->orderByColumnList(); - QMap<KexiDB::QueryColumnInfo*,int> columnsOrder( + TQMap<KexiDB::QueryColumnInfo*,int> columnsOrder( query->columnsOrder(KexiDB::QuerySchema::UnexpandedListWithoutAsterisks) ); for (KexiDB::OrderByColumn::ListConstIterator orderByColumnsIt( orderByColumns.constBegin() ); orderByColumnsIt!=orderByColumns.constEnd(); ++orderByColumnsIt) @@ -961,7 +961,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( if (column) { //sorting for visible column if (column->visible) { - if (columnsOrder.contains(column)) { + if (columnsOrder.tqcontains(column)) { const int columnPosition = columnsOrder[ column ]; rowItem = d->data->at( columnPosition ); rowPropertySet = d->sets->at( columnPosition ); @@ -974,7 +974,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( else if ((*orderByColumnsIt).field()) { //this will be presented as invisible field: create new row field = (*orderByColumnsIt).field(); - QString tableName( field->table() ? field->table()->name() : QString::null ); + TQString tableName( field->table() ? field->table()->name() : TQString() ); rowItem = createNewRow( tableName, field->name(), false /* !visible*/); d->dataTable->dataAwareObject()->insertItem(rowItem, row_num); rowPropertySet = createPropertySet( row_num, tableName, field->name(), true /*newOne*/ ); @@ -992,17 +992,17 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( d->data->saveRowChanges(*rowItem, true); (*rowPropertySet)["sorting"].clearModifiedFlag(); // this property should look "fresh" if (!rowItem->at(COLUMN_ID_VISIBLE).toBool()) //update - (*rowPropertySet)["visible"].setValue(QVariant(false,0), false/*rememberOldValue*/); + (*rowPropertySet)["visible"].setValue(TQVariant(false,0), false/*rememberOldValue*/); } } //5. Show fields for unused criterias (with "Visible" column set to false) KexiDB::BaseExpr *criteriaArgument; // <-- contains field or table.field - for (QDictIterator<KexiDB::BaseExpr> it(criterias); (criteriaArgument = it.current()); ++it) { + for (TQDictIterator<KexiDB::BaseExpr> it(criterias); (criteriaArgument = it.current()); ++it) { if (usedCriterias[it.current()]) continue; //unused: append a new row - KexiDB::BinaryExpr *criteriaExpr = criteriaArgument->parent()->toBinary(); + KexiDB::BinaryExpr *criteriaExpr = criteriaArgument->tqparent()->toBinary(); if (!criteriaExpr) { kexipluginswarn << "KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal(): " "criteriaExpr is not a binary expr" << endl; @@ -1018,7 +1018,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( } } KexiDB::Field* field = 0; - if (-1 == columnNameArgument->name.find('.') && query->tables()->count()==1) { + if (-1 == columnNameArgument->name.tqfind('.') && query->tables()->count()==1) { //extreme case: only field name provided for one-table query: field = query->tables()->first()->field(columnNameArgument->name); } @@ -1031,7 +1031,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( "no columnInfo found in the query for name \"" << columnNameArgument->name << endl; continue; } - QString tableName, fieldName, columnAlias, criteriaString; + TQString tableName, fieldName, columnAlias, criteriaString; //! @todo what about ALIAS? tableName = field->table()->name(); fieldName = field->name(); @@ -1052,7 +1052,7 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( //! @todo set["alias"].setValue(columnAlias, false); //// if (!criteriaString.isEmpty()) set["criteria"].setValue( criteriaString, false ); - set["visible"].setValue( QVariant(false,1), false ); + set["visible"].setValue( TQVariant(false,1), false ); } //current property set has most probably changed @@ -1067,32 +1067,32 @@ void KexiQueryDesignerGuiEditor::showFieldsOrRelationsForQueryInternal( bool KexiQueryDesignerGuiEditor::loadLayout() { - QString xml; + TQString xml; // if (!loadDataBlock( xml, "query_layout" )) { loadDataBlock( xml, "query_layout" ); //TODO errmsg // return false; // } if (xml.isEmpty()) { - //in a case when query layout was not saved, build layout by hand + //in a case when query tqlayout was not saved, build tqlayout by hand // -- dynamic cast because of a need for handling invalid queries // (as in KexiQueryDesignerGuiEditor::afterSwitchFrom()): - KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(parentDialog()->schemaData()); + KexiDB::QuerySchema * q = dynamic_cast<KexiDB::QuerySchema *>(tqparentDialog()->schemaData()); if (q) { showTablesForQuery( q ); KexiDB::ResultInfo result; showRelationsForQuery( q, result ); if (!result.success) { - parentDialog()->setStatus(&result, i18n("Query definition loading failed.")); + tqparentDialog()->settqStatus(&result, i18n("Query definition loading failed.")); return false; } } return true; } - QDomDocument doc; + TQDomDocument doc; doc.setContent(xml); - QDomElement doc_el = doc.documentElement(), el; + TQDomElement doc_el = doc.documentElement(), el; if (doc_el.tagName()!="query_layout") { //TODO errmsg return false; @@ -1108,9 +1108,9 @@ bool KexiQueryDesignerGuiEditor::loadLayout() int y = el.attribute("y","-1").toInt(); int width = el.attribute("width","-1").toInt(); int height = el.attribute("height","-1").toInt(); - QRect rect; + TQRect rect; if (x!=-1 || y!=-1 || width!=-1 || height!=-1) - rect = QRect(x,y,width,height); + rect = TQRect(x,y,width,height); d->relations->addTable( t, rect ); } else if (el.tagName()=="conn") { @@ -1140,30 +1140,30 @@ bool KexiQueryDesignerGuiEditor::storeLayout() KexiDB::Connection::SelectStatementOptions options; options.identifierEscaping = KexiDB::Driver::EscapeKexi|KexiDB::Driver::EscapeAsNecessary; options.addVisibleLookupColumns = false; - QString sqlText = dbConn->selectStatement( *temp->query(), options ); + TQString sqlText = dbConn->selectStatement( *temp->query(), options ); if (!storeDataBlock( sqlText, "sql" )) { return false; } //serialize detailed XML query definition - QString xml = "<query_layout>", tmp; + TQString xml = "<query_layout>", tmp; for (TablesDictIterator it(*d->relations->tables()); it.current(); ++it) { KexiRelationViewTableContainer *table_cont = it.current(); /*! @todo what about query? */ - tmp = QString("<table name=\"")+QString(table_cont->schema()->name())+"\" x=\"" - +QString::number(table_cont->x()) - +"\" y=\""+QString::number(table_cont->y()) - +"\" width=\""+QString::number(table_cont->width()) - +"\" height=\""+QString::number(table_cont->height()) + tmp = TQString("<table name=\"")+TQString(table_cont->schema()->name())+"\" x=\"" + +TQString::number(table_cont->x()) + +"\" y=\""+TQString::number(table_cont->y()) + +"\" width=\""+TQString::number(table_cont->width()) + +"\" height=\""+TQString::number(table_cont->height()) +"\"/>"; xml += tmp; } KexiRelationViewConnection *con; for (ConnectionListIterator it(*d->relations->connections()); (con = it.current()); ++it) { - tmp = QString("<conn mtable=\"") + QString(con->masterTable()->schema()->name()) + tmp = TQString("<conn mtable=\"") + TQString(con->masterTable()->schema()->name()) + "\" mfield=\"" + con->masterField() + "\" dtable=\"" - + QString(con->detailsTable()->schema()->name()) + + TQString(con->detailsTable()->schema()->name()) + "\" dfield=\"" + con->detailsField() + "\"/>"; xml += tmp; } @@ -1177,19 +1177,19 @@ bool KexiQueryDesignerGuiEditor::storeLayout() return true; } -QSize KexiQueryDesignerGuiEditor::sizeHint() const +TQSize KexiQueryDesignerGuiEditor::tqsizeHint() const { - QSize s1 = d->relations->sizeHint(); - QSize s2 = d->head->sizeHint(); - return QSize(QMAX(s1.width(),s2.width()), s1.height()+s2.height()); + TQSize s1 = d->relations->tqsizeHint(); + TQSize s2 = d->head->tqsizeHint(); + return TQSize(TQMAX(s1.width(),s2.width()), s1.height()+s2.height()); } KexiTableItem* -KexiQueryDesignerGuiEditor::createNewRow(const QString& tableName, const QString& fieldName, +KexiQueryDesignerGuiEditor::createNewRow(const TQString& tableName, const TQString& fieldName, bool visible) const { KexiTableItem *newItem = d->data->createItem(); - QString key; + TQString key; if (tableName=="*") key="*"; else { @@ -1199,15 +1199,15 @@ KexiQueryDesignerGuiEditor::createNewRow(const QString& tableName, const QString } (*newItem)[COLUMN_ID_COLUMN]=key; (*newItem)[COLUMN_ID_TABLE]=tableName; - (*newItem)[COLUMN_ID_VISIBLE]=QVariant(visible, 1); -#ifndef KEXI_NO_QUERY_TOTALS - (*newItem)[COLUMN_ID_TOTALS]=QVariant(0); + (*newItem)[COLUMN_ID_VISIBLE]=TQVariant(visible, 1); +#ifndef KEXI_NO_TQUERY_TOTALS + (*newItem)[COLUMN_ID_TOTALS]=TQVariant(0); #endif return newItem; } void KexiQueryDesignerGuiEditor::slotDragOverTableRow( - KexiTableItem * /*item*/, int /*row*/, QDragMoveEvent* e) + KexiTableItem * /*item*/, int /*row*/, TQDragMoveEvent* e) { if (e->provides("kexi/field")) { e->acceptAction(true); @@ -1216,11 +1216,11 @@ void KexiQueryDesignerGuiEditor::slotDragOverTableRow( void KexiQueryDesignerGuiEditor::slotDroppedAtRow(KexiTableItem * /*item*/, int /*row*/, - QDropEvent *ev, KexiTableItem*& newItem) + TQDropEvent *ev, KexiTableItem*& newItem) { - QString sourceMimeType; - QString srcTable; - QString srcField; + TQString sourceMimeType; + TQString srcTable; + TQString srcField; if (!KexiFieldDrag::decodeSingle(ev,sourceMimeType,srcTable,srcField)) return; @@ -1236,10 +1236,10 @@ void KexiQueryDesignerGuiEditor::slotNewItemAppendedForAfterDeletingInSpreadShee { KexiTableItem *item = d->data->last(); if (item) - item->at(COLUMN_ID_VISIBLE) = QVariant(false, 0); //the same init as in initTableRows() + item->at(COLUMN_ID_VISIBLE) = TQVariant(false, 0); //the same init as in initTableRows() } -void KexiQueryDesignerGuiEditor::slotRowInserted(KexiTableItem* item, uint row, bool /*repaint*/) +void KexiQueryDesignerGuiEditor::slotRowInserted(KexiTableItem* item, uint row, bool /*tqrepaint*/) { if (d->droppedNewItem && d->droppedNewItem==item) { createPropertySet( row, d->droppedNewTable, d->droppedNewField, true ); @@ -1264,35 +1264,35 @@ void KexiQueryDesignerGuiEditor::slotTableHidden(KexiDB::TableSchema & /*t*/) } /*! @internal generates smallest unique alias */ -QCString KexiQueryDesignerGuiEditor::generateUniqueAlias() const +TQCString KexiQueryDesignerGuiEditor::generateUniqueAlias() const { //TODO: add option for using non-i18n'd "expr" prefix? - const QCString expStr + const TQCString expStr = i18n("short for 'expression' word (only latin letters, please)", "expr").latin1(); //TODO: optimization: cache it? - QAsciiDict<char> aliases(101); + TQAsciiDict<char> aliases(101); for (int r = 0; r<(int)d->sets->size(); r++) { KoProperty::Set *set = d->sets->at(r); if (set) { - const QCString a = (*set)["alias"].value().toCString().lower(); + const TQCString a = (*set)["alias"].value().toCString().lower(); if (!a.isEmpty()) aliases.insert(a,(char*)1); } } int aliasNr=1; for (;;aliasNr++) { - if (!aliases[expStr+QString::number(aliasNr).latin1()]) + if (!aliases[expStr+TQString::number(aliasNr).latin1()]) break; } - return expStr+QString::number(aliasNr).latin1(); + return expStr+TQString::number(aliasNr).latin1(); } //! @todo this is primitive, temporary: reuse SQL parser KexiDB::BaseExpr* -KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int& token, +KexiQueryDesignerGuiEditor::parseExpressionString(const TQString& fullString, int& token, bool allowRelationalOperator) { - QString str = fullString.stripWhiteSpace(); + TQString str = fullString.stripWhiteSpace(); int len = 0; //KexiDB::BaseExpr *expr = 0; //1. get token @@ -1333,7 +1333,7 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int return 0; KexiDB::BaseExpr *valueExpr = 0; - QRegExp re; + TQRegExp re; if (str.length()>=2 && ( (str.startsWith("\"") && str.endsWith("\"")) @@ -1345,38 +1345,38 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int else if (str.startsWith("[") && str.endsWith("]")) { valueExpr = new KexiDB::QueryParameterExpr(str.mid(1,str.length()-2)); } - else if ((re = QRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})")).exactMatch( str )) + else if ((re = TQRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})")).exactMatch( str )) { - valueExpr = new KexiDB::ConstExpr(DATE_CONST, QDate::fromString( + valueExpr = new KexiDB::ConstExpr(DATE_CONST, TQDate::fromString( re.cap(1).rightJustify(4, '0')+"-"+re.cap(2).rightJustify(2, '0') +"-"+re.cap(3).rightJustify(2, '0'), Qt::ISODate)); } - else if ((re = QRegExp("(\\d{1,2}):(\\d{1,2})")).exactMatch( str ) - || (re = QRegExp("(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str )) + else if ((re = TQRegExp("(\\d{1,2}):(\\d{1,2})")).exactMatch( str ) + || (re = TQRegExp("(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str )) { - QString res = re.cap(1).rightJustify(2, '0')+":"+re.cap(2).rightJustify(2, '0') + TQString res = re.cap(1).rightJustify(2, '0')+":"+re.cap(2).rightJustify(2, '0') +":"+re.cap(3).rightJustify(2, '0'); // kexipluginsdbg << res << endl; - valueExpr = new KexiDB::ConstExpr(TIME_CONST, QTime::fromString(res, Qt::ISODate)); + valueExpr = new KexiDB::ConstExpr(TIME_CONST, TQTime::fromString(res, Qt::ISODate)); } - else if ((re = QRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2})")).exactMatch( str ) - || (re = QRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str )) + else if ((re = TQRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2})")).exactMatch( str ) + || (re = TQRegExp("(\\d{1,4})-(\\d{1,2})-(\\d{1,2})\\s+(\\d{1,2}):(\\d{1,2}):(\\d{1,2})")).exactMatch( str )) { - QString res = re.cap(1).rightJustify(4, '0')+"-"+re.cap(2).rightJustify(2, '0') + TQString res = re.cap(1).rightJustify(4, '0')+"-"+re.cap(2).rightJustify(2, '0') +"-"+re.cap(3).rightJustify(2, '0') +"T"+re.cap(4).rightJustify(2, '0')+":"+re.cap(5).rightJustify(2, '0') +":"+re.cap(6).rightJustify(2, '0'); // kexipluginsdbg << res << endl; valueExpr = new KexiDB::ConstExpr(DATETIME_CONST, - QDateTime::fromString(res, Qt::ISODate)); + TQDateTime::fromString(res, Qt::ISODate)); } else if (str[0]>='0' && str[0]<='9' || str[0]=='-' || str[0]=='+') { //number - QString decimalSym = KGlobal::locale()->decimalSymbol(); + TQString decimalSym = KGlobal::locale()->decimalSymbol(); bool ok; - int pos = str.find('.'); + int pos = str.tqfind('.'); if (pos==-1) {//second chance: local decimal symbol - pos = str.find(decimalSym); + pos = str.tqfind(decimalSym); } if (pos>=0) {//real const number const int left = str.left(pos).toInt(&ok); @@ -1385,18 +1385,18 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int const int right = str.mid(pos+1).toInt(&ok); if (!ok) return 0; - valueExpr = new KexiDB::ConstExpr(REAL_CONST, QPoint(left,right)); //decoded to QPoint + valueExpr = new KexiDB::ConstExpr(REAL_CONST, TQPoint(left,right)); //decoded to TQPoint } else { //integer const - const Q_LLONG val = str.toLongLong(&ok); + const TQ_LLONG val = str.toLongLong(&ok); if (!ok) return 0; valueExpr = new KexiDB::ConstExpr(INTEGER_CONST, val); } } else if (str.lower()=="null") { - valueExpr = new KexiDB::ConstExpr(SQL_NULL, QVariant()); + valueExpr = new KexiDB::ConstExpr(SQL_NULL, TQVariant()); } else {//identfier if (!KexiUtils::isIdentifier(str)) @@ -1415,33 +1415,33 @@ KexiQueryDesignerGuiEditor::parseExpressionString(const QString& fullString, int } void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int colnum, - QVariant& newValue, KexiDB::ResultInfo* result) + TQVariant& newValue, KexiDB::ResultInfo* result) { if (colnum == COLUMN_ID_COLUMN) { if (newValue.isNull()) { - d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, QVariant(), false/*!allowSignals*/); - d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, QVariant(false,1));//invisible - d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, QVariant()); -#ifndef KEXI_NO_QUERY_TOTALS - d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant());//remove totals + d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(), false/*!allowSignals*/); + d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible + d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant()); +#ifndef KEXI_NO_TQUERY_TOTALS + d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals #endif - d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, QVariant());//remove crit. + d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit. d->sets->removeCurrentPropertySet(); } else { //auto fill 'table' column - QString fieldId( newValue.toString().stripWhiteSpace() ); //tmp, can look like "table.field" - QString fieldName; //"field" part of "table.field" or expression string - QString tableName; //empty for expressions - QCString alias; - QString columnValueForExpr; //for setting pretty printed "alias: expr" in 1st column + TQString fieldId( newValue.toString().stripWhiteSpace() ); //tmp, can look like "table.field" + TQString fieldName; //"field" part of "table.field" or expression string + TQString tableName; //empty for expressions + TQCString alias; + TQString columnValueForExpr; //for setting pretty printed "alias: expr" in 1st column const bool isExpression = !d->fieldColumnIdentifiers[fieldId]; if (isExpression) { //this value is entered by hand and doesn't match //any value in the combo box -- we're assuming this is an expression //-table remains null - //-find "alias" in something like "alias : expr" - const int id = fieldId.find(':'); + //-tqfind "alias" in something like "alias : expr" + const int id = fieldId.tqfind(':'); if (id>0) { alias = fieldId.left(id).stripWhiteSpace().latin1(); if (!KexiUtils::isIdentifier(alias)) { @@ -1449,7 +1449,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int result->allowToDiscardChanges = true; result->column = colnum; result->msg = i18n("Entered column alias \"%1\" is not a valid identifier.") - .arg(alias); + .tqarg(alias.data()); result->desc = i18n("Identifiers should start with a letter or '_' character"); return; } @@ -1468,7 +1468,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int result->success = false; result->allowToDiscardChanges = true; result->column = colnum; - result->msg = i18n("Invalid expression \"%1\"").arg(fieldName); + result->msg = i18n("Invalid expression \"%1\"").tqarg(fieldName); return; } } @@ -1490,7 +1490,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int KoProperty::Set *set = d->sets->findPropertySetForItem(*item); //*propertyBuffer(); if (!set) { saveOldValue = false; // no old val. - const int row = d->data->findRef(item); + const int row = d->data->tqfindRef(item); if (row<0) { result->success = false; return; @@ -1498,15 +1498,15 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int set = createPropertySet( row, tableName, fieldName, true ); propertySetSwitched(); } - d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, QVariant(tableName), false/*!allowSignals*/); - d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, QVariant(true,1)); -#ifndef KEXI_NO_QUERY_TOTALS - d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant(0)); + d->data->updateRowEditBuffer(item, COLUMN_ID_TABLE, TQVariant(tableName), false/*!allowSignals*/); + d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(true,1)); +#ifndef KEXI_NO_TQUERY_TOTALS + d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0)); #endif if (!sortingAllowed(fieldName, tableName)) { // sorting is not available for "*" or "table.*" rows //! @todo what about expressions? - d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, QVariant()); + d->data->updateRowEditBuffer(item, COLUMN_ID_SORTING, TQVariant()); } //update properties (*set)["field"].setValue(fieldName, saveOldValue); @@ -1517,13 +1517,13 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int if (alias.isEmpty()) //-generate smallest unique alias alias = generateUniqueAlias(); } - (*set)["isExpression"].setValue(QVariant(isExpression,1), saveOldValue); + (*set)["isExpression"].setValue(TQVariant(isExpression,1), saveOldValue); if (!alias.isEmpty()) { (*set)["alias"].setValue(alias, saveOldValue); //pretty printed "alias: expr" - newValue = QString(alias) + ": " + fieldName; + newValue = TQString(alias) + ": " + fieldName; } - (*set)["caption"].setValue(QString::null, saveOldValue); + (*set)["caption"].setValue(TQString(), saveOldValue); (*set)["table"].setValue(tableName, saveOldValue); updatePropertiesVisibility(*set); } @@ -1531,12 +1531,12 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int else if (colnum==COLUMN_ID_TABLE) { if (newValue.isNull()) { if (!item->at(COLUMN_ID_COLUMN).toString().isEmpty()) - d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, QVariant(), false/*!allowSignals*/); - d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, QVariant(false,1));//invisible -#ifndef KEXI_NO_QUERY_TOTALS - d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant());//remove totals + d->data->updateRowEditBuffer(item, COLUMN_ID_COLUMN, TQVariant(), false/*!allowSignals*/); + d->data->updateRowEditBuffer(item, COLUMN_ID_VISIBLE, TQVariant(false,1));//invisible +#ifndef KEXI_NO_TQUERY_TOTALS + d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant());//remove totals #endif - d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, QVariant());//remove crit. + d->data->updateRowEditBuffer(item, COLUMN_ID_CRITERIA, TQVariant());//remove crit. d->sets->removeCurrentPropertySet(); } //update property @@ -1544,11 +1544,11 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int if (set) { if ((*set)["isExpression"].value().toBool()==false) { (*set)["table"] = newValue; - (*set)["caption"] = QString::null; + (*set)["caption"] = TQString(); } else { //do not set table for expr. columns - newValue = QVariant(); + newValue = TQVariant(); } // KoProperty::Set &set = *propertyBuffer(); updatePropertiesVisibility(*set); @@ -1560,15 +1560,15 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int saveOldValue = false; createPropertySet( d->dataTable->dataAwareObject()->currentRow(), item->at(COLUMN_ID_TABLE).toString(), item->at(COLUMN_ID_COLUMN).toString(), true ); -#ifndef KEXI_NO_QUERY_TOTALS - d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, QVariant(0));//totals +#ifndef KEXI_NO_TQUERY_TOTALS + d->data->updateRowEditBuffer(item, COLUMN_ID_TOTALS, TQVariant(0));//totals #endif propertySetSwitched(); } KoProperty::Set &set = *propertySet(); set["visible"].setValue(newValue, saveOldValue); } -#ifndef KEXI_NO_QUERY_TOTALS +#ifndef KEXI_NO_TQUERY_TOTALS else if (colnum==COLUMN_ID_TOTALS) { //TODO: //unused yet @@ -1577,11 +1577,11 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int #endif else if (colnum==COLUMN_ID_SORTING) { KoProperty::Set *set = d->sets->findPropertySetForItem(*item); - QString table( set->property("table").value().toString() ); - QString field( set->property("field").value().toString() ); + TQString table( set->property("table").value().toString() ); + TQString field( set->property("field").value().toString() ); if (newValue.toInt()==0 || sortingAllowed(field, table)) { KoProperty::Property &property = set->property("sorting"); - QString key( property.listData()->keysAsStringList()[ newValue.toInt() ] ); + TQString key( property.listData()->keysAsStringList()[ newValue.toInt() ] ); kexipluginsdbg << "new key=" << key << endl; property.setValue(key, true); } @@ -1590,29 +1590,29 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int result->allowToDiscardChanges = true; result->column = colnum; result->msg = i18n("Could not set sorting for multiple columns (%1)") - .arg(table=="*" ? table : (table+".*")); + .tqarg(table=="*" ? table : (table+".*")); } } else if (colnum==COLUMN_ID_CRITERIA) { //! @todo this is primitive, temporary: reuse SQL parser - QString operatorStr, argStr; + TQString operatorStr, argStr; KexiDB::BaseExpr* e = 0; - const QString str = newValue.toString().stripWhiteSpace(); + const TQString str = newValue.toString().stripWhiteSpace(); int token; - QString field, table; + TQString field, table; KoProperty::Set *set = d->sets->findPropertySetForItem(*item); if (set) { field = (*set)["field"].value().toString(); table = (*set)["table"].value().toString(); } - if (!str.isEmpty() && (!set || table=="*" || field.find("*")!=-1)) { + if (!str.isEmpty() && (!set || table=="*" || field.tqfind("*")!=-1)) { //asterisk found! criteria not allowed result->success = false; result->allowToDiscardChanges = true; result->column = colnum; if (propertySet()) result->msg = i18n("Could not set criteria for \"%1\"") - .arg(table=="*" ? table : field); + .tqarg(table=="*" ? table : field); else result->msg = i18n("Could not set criteria for empty row"); //moved to result->allowToDiscardChanges handler //d->dataTable->dataAwareObject()->cancelEditor(); //prevents further editing of this cell @@ -1620,7 +1620,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int else if (str.isEmpty() || (e = parseExpressionString(str, token, true/*allowRelationalOperator*/))) { if (e) { - QString tokenStr; + TQString tokenStr; if (token!='=') { KexiDB::BinaryExpr be(KexiDBExpr_Relational, 0, token, 0); tokenStr = be.tokenToString() + " "; @@ -1630,7 +1630,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int delete e; } else if (str.isEmpty()) { - (*set)["criteria"] = QVariant(); //clear it + (*set)["criteria"] = TQVariant(); //clear it } setDirty(true); } @@ -1638,7 +1638,7 @@ void KexiQueryDesignerGuiEditor::slotBeforeCellChanged(KexiTableItem *item, int result->success = false; result->allowToDiscardChanges = true; result->column = colnum; - result->msg = i18n("Invalid criteria \"%1\"").arg(newValue.toString()); + result->msg = i18n("Invalid criteria \"%1\"").tqarg(newValue.toString()); } } } @@ -1654,7 +1654,7 @@ void KexiQueryDesignerGuiEditor::slotAboutConnectionRemove(KexiRelationViewConne } void KexiQueryDesignerGuiEditor::slotTableFieldDoubleClicked( - KexiDB::TableSchema* table, const QString& fieldName ) + KexiDB::TableSchema* table, const TQString& fieldName ) { if (!table || (!table->field(fieldName) && fieldName!="*")) return; @@ -1695,10 +1695,10 @@ void KexiQueryDesignerGuiEditor::updatePropertiesVisibility(KoProperty::Set& set KoProperty::Set* KexiQueryDesignerGuiEditor::createPropertySet( int row, - const QString& tableName, const QString& fieldName, bool newOne ) + const TQString& tableName, const TQString& fieldName, bool newOne ) { //const bool asterisk = isAsterisk(tableName, fieldName); - QString typeName = "KexiQueryDesignerGuiEditor::Column"; + TQString typeName = "KexiQueryDesignerGuiEditor::Column"; KoProperty::Set *set = new KoProperty::Set(d->sets, typeName); KoProperty::Property *prop; @@ -1708,42 +1708,42 @@ KexiQueryDesignerGuiEditor::createPropertySet( int row, //! \todo add table_field icon (add buff->addProperty(prop = new KexiProperty("this:iconName", "table_field") ); // prop->setVisible(false); - set->addProperty(prop = new KoProperty::Property("table", QVariant(tableName)) ); + set->addProperty(prop = new KoProperty::Property("table", TQVariant(tableName)) ); prop->setVisible(false);//always hidden - set->addProperty(prop = new KoProperty::Property("field", QVariant(fieldName)) ); + set->addProperty(prop = new KoProperty::Property("field", TQVariant(fieldName)) ); prop->setVisible(false);//always hidden - set->addProperty(prop = new KoProperty::Property("caption", QVariant(QString::null), i18n("Caption") ) ); + set->addProperty(prop = new KoProperty::Property("caption", TQVariant(TQString()), i18n("Caption") ) ); #ifdef KEXI_NO_UNFINISHED prop->setVisible(false); #endif - set->addProperty(prop = new KoProperty::Property("alias", QVariant(QString::null), i18n("Alias")) ); + set->addProperty(prop = new KoProperty::Property("alias", TQVariant(TQString()), i18n("Alias")) ); - set->addProperty(prop = new KoProperty::Property("visible", QVariant(true, 4)) ); + set->addProperty(prop = new KoProperty::Property("visible", TQVariant(true, 4)) ); prop->setVisible(false); /*TODO: - set->addProperty(prop = new KexiProperty("totals", QVariant(QString::null)) ); + set->addProperty(prop = new KexiProperty("totals", TQVariant(TQString())) ); prop->setVisible(false);*/ //sorting - QStringList slist, nlist; + TQStringList slist, nlist; slist << "nosorting" << "ascending" << "descending"; nlist << i18n("None") << i18n("Ascending") << i18n("Descending"); set->addProperty(prop = new KoProperty::Property("sorting", slist, nlist, *slist.at(0), i18n("Sorting"))); prop->setVisible(false); - set->addProperty(prop = new KoProperty::Property("criteria", QVariant(QString::null)) ); + set->addProperty(prop = new KoProperty::Property("criteria", TQVariant(TQString())) ); prop->setVisible(false); - set->addProperty(prop = new KoProperty::Property("isExpression", QVariant(false, 1)) ); + set->addProperty(prop = new KoProperty::Property("isExpression", TQVariant(false, 1)) ); prop->setVisible(false); - connect(set, SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)), - this, SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&))); + connect(set, TQT_SIGNAL(propertyChanged(KoProperty::Set&, KoProperty::Property&)), + this, TQT_SLOT(slotPropertyChanged(KoProperty::Set&, KoProperty::Property&))); d->sets->insert(row, set, newOne); @@ -1758,12 +1758,12 @@ void KexiQueryDesignerGuiEditor::setFocus() void KexiQueryDesignerGuiEditor::slotPropertyChanged(KoProperty::Set& set, KoProperty::Property& property) { - const QCString& pname = property.name(); + const TQCString& pname = property.name(); /* - * TODO (js) use KexiProperty::setValidator(QString) when implemented as described in TODO #60 + * TODO (js) use KexiProperty::setValidator(TQString) when implemented as described in TODO #60 */ if (pname=="alias" || pname=="name") { - const QVariant& v = property.value(); + const TQVariant& v = property.value(); if (!v.toString().stripWhiteSpace().isEmpty() && !KexiUtils::isIdentifier( v.toString() )) { KMessageBox::sorry(this, KexiUtils::identifierExpectedMessage(property.caption(), v.toString())); @@ -1776,7 +1776,7 @@ void KexiQueryDesignerGuiEditor::slotPropertyChanged(KoProperty::Set& set, KoPro // d->dataTable->dataAwareObject()->setCursorPosition(d->dataTable->dataAwareObject()->currentRow(),0); //d->dataTable->dataAwareObject()->startEditCurrentCell(); d->data->updateRowEditBuffer(d->dataTable->dataAwareObject()->selectedItem(), - 0, QVariant(set["alias"].value().toString() + ": " + set["field"].value().toString())); + 0, TQVariant(set["alias"].value().toString() + ": " + set["field"].value().toString())); d->data->saveRowChanges(*d->dataTable->dataAwareObject()->selectedItem(), true); // d->dataTable->dataAwareObject()->acceptRowEdit(); } @@ -1794,7 +1794,7 @@ void KexiQueryDesignerGuiEditor::slotItemRemoved(const KexiPart::Item& item) d->relations->objectDeleted(item.mimeType(), item.name().latin1()); } -void KexiQueryDesignerGuiEditor::slotItemRenamed(const KexiPart::Item& item, const QCString& oldName) +void KexiQueryDesignerGuiEditor::slotItemRenamed(const KexiPart::Item& item, const TQCString& oldName) { d->relations->objectRenamed(item.mimeType(), oldName, item.name().latin1()); } |