diff options
Diffstat (limited to 'kommander/editor/tableeditorimpl.cpp')
-rw-r--r-- | kommander/editor/tableeditorimpl.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/kommander/editor/tableeditorimpl.cpp b/kommander/editor/tableeditorimpl.cpp index d8cfc70d..6b5ce13e 100644 --- a/kommander/editor/tableeditorimpl.cpp +++ b/kommander/editor/tableeditorimpl.cpp @@ -1,18 +1,18 @@ #include "tableeditorimpl.h" #ifndef QT_NO_TABLE -#include <qtable.h> +#include <tqtable.h> #endif #include "formwindow.h" -#include <qlabel.h> -#include <qcombobox.h> -#include <qheader.h> -#include <qlistbox.h> -#include <qlineedit.h> -#include <qpushbutton.h> +#include <tqlabel.h> +#include <tqcombobox.h> +#include <tqheader.h> +#include <tqlistbox.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> #include "pixmapchooser.h" #include "command.h" -#include <qvaluelist.h> -#include <qtabwidget.h> +#include <tqvaluelist.h> +#include <tqtabwidget.h> #ifndef KOMMANDER #include "project.h" #endif @@ -21,26 +21,26 @@ #include <klocale.h> -TableEditor::TableEditor( QWidget* parent, QWidget *editWidget, FormWindow *fw, const char* name, bool modal, WFlags fl ) +TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *fw, const char* name, bool modal, WFlags fl ) : TableEditorBase( parent, name, modal, fl ), #ifndef QT_NO_TABLE - editTable( (QTable*)editWidget ), + editTable( (TQTable*)editWidget ), #endif formWindow( fw ) { - connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) ); + connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) ); #ifndef QT_NO_TABLE labelColumnPixmap->setText( "" ); labelRowPixmap->setText( "" ); - if ( !editTable->inherits( "QDataTable" ) ) { + if ( !editTable->inherits( "TQDataTable" ) ) { labelFields->hide(); comboFields->hide(); labelTable->hide(); labelTableValue->hide(); } #ifndef QT_NO_SQL - if ( editTable->inherits( "QDataTable" ) ) { + if ( editTable->inherits( "TQDataTable" ) ) { // ## why does this behave weird? // TabWidget->removePage( rows_tab ); // rows_tab->hide(); @@ -48,10 +48,10 @@ TableEditor::TableEditor( QWidget* parent, QWidget *editWidget, FormWindow *fw, TabWidget->setTabEnabled( rows_tab, false ); } - if ( formWindow->project() && editTable->inherits( "QDataTable" ) ) { - QStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList(); + if ( formWindow->project() && editTable->inherits( "TQDataTable" ) ) { + TQStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList(); if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) { - QStringList fields; + TQStringList fields; fields << i18n( "<no field>" ); fields += formWindow->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] ); comboFields->insertStringList( fields ); @@ -77,7 +77,7 @@ void TableEditor::columnDownClicked() return; saveFieldMap(); int index = listColumns->currentItem() + 1; - QListBoxItem *i = listColumns->item( listColumns->currentItem() ); + TQListBoxItem *i = listColumns->item( listColumns->currentItem() ); listColumns->takeItem( i ); listColumns->insertItem( i, index ); listColumns->setCurrentItem( i ); @@ -86,7 +86,7 @@ void TableEditor::columnDownClicked() currentColumnChanged( i ); } -void TableEditor::columnTextChanged( const QString &s ) +void TableEditor::columnTextChanged( const TQString &s ) { if ( listColumns->currentItem() == -1 ) return; @@ -109,7 +109,7 @@ void TableEditor::columnUpClicked() return; saveFieldMap(); int index = listColumns->currentItem() - 1; - QListBoxItem *i = listColumns->item( listColumns->currentItem() ); + TQListBoxItem *i = listColumns->item( listColumns->currentItem() ); listColumns->takeItem( i ); listColumns->insertItem( i, index ); listColumns->setCurrentItem( i ); @@ -118,7 +118,7 @@ void TableEditor::columnUpClicked() currentColumnChanged( i ); } -void TableEditor::currentColumnChanged( QListBoxItem *i ) +void TableEditor::currentColumnChanged( TQListBoxItem *i ) { if ( !i ) return; @@ -131,8 +131,8 @@ void TableEditor::currentColumnChanged( QListBoxItem *i ) editColumnText->blockSignals( false ); #ifndef QT_NO_TABLE - if ( editTable->inherits( "QDataTable" ) ) { - QString s = *fieldMap.find( listColumns->index( i ) ); + if ( editTable->inherits( "TQDataTable" ) ) { + TQString s = *fieldMap.find( listColumns->index( i ) ); if ( s.isEmpty() ) comboFields->setCurrentItem( 0 ); else if ( comboFields->listBox()->findItem( s ) ) @@ -143,20 +143,20 @@ void TableEditor::currentColumnChanged( QListBoxItem *i ) #endif } -void TableEditor::currentFieldChanged( const QString &s ) +void TableEditor::currentFieldChanged( const TQString &s ) { if ( listColumns->currentItem() == -1 ) return; fieldMap.remove( listColumns->currentItem() ); fieldMap.insert( listColumns->currentItem(), s ); editColumnText->blockSignals( true ); //## necessary - QString newColText = s.mid(0,1).upper() + s.mid(1); + TQString newColText = s.mid(0,1).upper() + s.mid(1); editColumnText->setText( newColText ); columnTextChanged( newColText ); editColumnText->blockSignals( false ); } -void TableEditor::currentRowChanged( QListBoxItem *i ) +void TableEditor::currentRowChanged( TQListBoxItem *i ) { if ( !i ) return; @@ -203,19 +203,19 @@ void TableEditor::newColumnClicked() { #ifndef QT_NO_TABLE table->setNumCols( table->numCols() + 1 ); - QMap<QString, bool> m; + TQMap<TQString, bool> m; for ( int i = 0; i < table->numCols() - 1; ++i ) m.insert( table->horizontalHeader()->label( i ), true ); int n = table->numCols() - 1; - QString t = QString::number( n ); + TQString t = TQString::number( n ); while ( m.find( t ) != m.end() ) - t = QString::number( ++n ); + t = TQString::number( ++n ); table->horizontalHeader()->setLabel( table->numCols() - 1, t ); listColumns->insertItem( t ); - QListBoxItem *item = listColumns->item( listColumns->count() - 1 ); + TQListBoxItem *item = listColumns->item( listColumns->count() - 1 ); listColumns->setCurrentItem( item ); listColumns->setSelected( item, true ); - if ( editTable->inherits( "QDataTable" ) ) { + if ( editTable->inherits( "TQDataTable" ) ) { comboFields->setFocus(); } else { editColumnText->setFocus(); @@ -228,16 +228,16 @@ void TableEditor::newRowClicked() { #ifndef QT_NO_TABLE table->setNumRows( table->numRows() + 1 ); - QMap<QString, bool> m; + TQMap<TQString, bool> m; for ( int i = 0; i < table->numRows() - 1; ++i ) m.insert( table->verticalHeader()->label( i ), true ); int n = table->numRows() - 1; - QString t = QString::number( n ); + TQString t = TQString::number( n ); while ( m.find( t ) != m.end() ) - t = QString::number( ++n ); + t = TQString::number( ++n ); table->verticalHeader()->setLabel( table->numRows() - 1, t ); listRows->insertItem( t ); - QListBoxItem *item = listRows->item( listRows->count() - 1 ); + TQListBoxItem *item = listRows->item( listRows->count() - 1 ); listRows->setCurrentItem( item ); listRows->setSelected( item, true ); #endif @@ -256,14 +256,14 @@ void TableEditor::rowDownClicked() listRows->count() < 2 ) return; int index = listRows->currentItem() + 1; - QListBoxItem *i = listRows->item( listRows->currentItem() ); + TQListBoxItem *i = listRows->item( listRows->currentItem() ); listRows->takeItem( i ); listRows->insertItem( i, index ); listRows->setCurrentItem( i ); readRows(); } -void TableEditor::rowTextChanged( const QString &s ) +void TableEditor::rowTextChanged( const TQString &s ) { if ( listRows->currentItem() == -1 ) return; @@ -283,7 +283,7 @@ void TableEditor::rowUpClicked() listRows->count() < 2 ) return; int index = listRows->currentItem() - 1; - QListBoxItem *i = listRows->item( listRows->currentItem() ); + TQListBoxItem *i = listRows->item( listRows->currentItem() ); listRows->takeItem( i ); listRows->insertItem( i, index ); listRows->setCurrentItem( i ); @@ -292,8 +292,8 @@ void TableEditor::rowUpClicked() void TableEditor::applyClicked() { - QValueList<PopulateTableCommand::Row> rows; - QValueList<PopulateTableCommand::Column> cols; + TQValueList<PopulateTableCommand::Row> rows; + TQValueList<PopulateTableCommand::Column> cols; int i = 0; #ifndef QT_NO_TABLE @@ -323,11 +323,11 @@ void TableEditor::chooseRowPixmapClicked() { if ( listRows->currentItem() == -1 ) return; - QPixmap pix; + TQPixmap pix; if ( listRows->item( listRows->currentItem() )->pixmap() ) pix = qChoosePixmap( this, formWindow, *listRows->item( listRows->currentItem() )->pixmap() ); else - pix = qChoosePixmap( this, formWindow, QPixmap() ); + pix = qChoosePixmap( this, formWindow, TQPixmap() ); if ( pix.isNull() ) return; @@ -343,7 +343,7 @@ void TableEditor::deleteRowPixmapClicked() if ( listRows->currentItem() == -1 ) return; #ifndef QT_NO_TABLE - table->verticalHeader()->setLabel( listRows->currentItem(), QPixmap(), table->verticalHeader()->label( listRows->currentItem() ) ); + table->verticalHeader()->setLabel( listRows->currentItem(), TQPixmap(), table->verticalHeader()->label( listRows->currentItem() ) ); listRows->changeItem( listRows->currentText(), listRows->currentItem() ); #endif } @@ -352,11 +352,11 @@ void TableEditor::chooseColPixmapClicked() { if ( listColumns->currentItem() == -1 ) return; - QPixmap pix; + TQPixmap pix; if ( listColumns->item( listColumns->currentItem() )->pixmap() ) pix = qChoosePixmap( this, formWindow, *listColumns->item( listColumns->currentItem() )->pixmap() ); else - pix = qChoosePixmap( this, formWindow, QPixmap() ); + pix = qChoosePixmap( this, formWindow, TQPixmap() ); if ( pix.isNull() ) return; @@ -371,7 +371,7 @@ void TableEditor::deleteColPixmapClicked() if ( listColumns->currentItem() == -1 ) return; #ifndef QT_NO_TABLE - table->horizontalHeader()->setLabel( listColumns->currentItem(), QPixmap(), table->horizontalHeader()->label( listColumns->currentItem() ) ); + table->horizontalHeader()->setLabel( listColumns->currentItem(), TQPixmap(), table->horizontalHeader()->label( listColumns->currentItem() ) ); listColumns->changeItem( listColumns->currentText(), listColumns->currentItem() ); #endif } @@ -379,9 +379,9 @@ void TableEditor::deleteColPixmapClicked() void TableEditor::readFromTable() { #ifndef QT_NO_TABLE - QHeader *cols = editTable->horizontalHeader(); + TQHeader *cols = editTable->horizontalHeader(); table->setNumCols( cols->count() ); - QMap<QString, QString> columnFields = MetaDataBase::columnFields( editTable ); + TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( editTable ); for ( int i = 0; i < cols->count(); ++i ) { if ( editTable->horizontalHeader()->iconSet( i ) ) { table->horizontalHeader()->setLabel( i, *editTable->horizontalHeader()->iconSet( i ), @@ -392,7 +392,7 @@ void TableEditor::readFromTable() table->horizontalHeader()->setLabel( i, editTable->horizontalHeader()->label( i ) ); listColumns->insertItem( editTable->horizontalHeader()->label( i ) ); } - QString cf = *columnFields.find( editTable->horizontalHeader()->label( i ) ); + TQString cf = *columnFields.find( editTable->horizontalHeader()->label( i ) ); fieldMap.insert( i, cf ); } @@ -401,7 +401,7 @@ void TableEditor::readFromTable() listColumns->setSelected( listColumns->firstItem(), true ); } - QHeader *rows = editTable->verticalHeader(); + TQHeader *rows = editTable->verticalHeader(); table->setNumRows( rows->count() ); for ( int j = 0; j < rows->count(); ++j ) { if ( editTable->verticalHeader()->iconSet( j ) ) { @@ -426,7 +426,7 @@ void TableEditor::readColumns() { int j = 0; #ifndef QT_NO_TABLE - for ( QListBoxItem *i = listColumns->firstItem(); i; i = i->next(), ++j ) { + for ( TQListBoxItem *i = listColumns->firstItem(); i; i = i->next(), ++j ) { if ( i->pixmap() ) table->horizontalHeader()->setLabel( j, *i->pixmap(), i->text() ); else @@ -439,7 +439,7 @@ void TableEditor::readRows() { int j = 0; #ifndef QT_NO_TABLE - for ( QListBoxItem *i = listRows->firstItem(); i; i = i->next(), ++j ) { + for ( TQListBoxItem *i = listRows->firstItem(); i; i = i->next(), ++j ) { if ( i->pixmap() ) table->verticalHeader()->setLabel( j, *i->pixmap(), i->text() ); else @@ -451,14 +451,14 @@ void TableEditor::readRows() void TableEditor::saveFieldMap() { tmpFieldMap.clear(); - for ( QMap<int, QString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it ) + for ( TQMap<int, TQString>::Iterator it = fieldMap.begin(); it != fieldMap.end(); ++it ) tmpFieldMap.insert( listColumns->item( it.key() ), *it ); } void TableEditor::restoreFieldMap() { fieldMap.clear(); - for ( QMap<QListBoxItem*, QString>::Iterator it = tmpFieldMap.begin(); it != tmpFieldMap.end(); ++it ) + for ( TQMap<TQListBoxItem*, TQString>::Iterator it = tmpFieldMap.begin(); it != tmpFieldMap.end(); ++it ) fieldMap.insert( listColumns->index( it.key() ), *it ); } #include "tableeditorimpl.moc" |