summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/tableeditorimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/tableeditorimpl.cpp')
-rw-r--r--kdevdesigner/designer/tableeditorimpl.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/kdevdesigner/designer/tableeditorimpl.cpp b/kdevdesigner/designer/tableeditorimpl.cpp
index b2a440de..d6ebba6c 100644
--- a/kdevdesigner/designer/tableeditorimpl.cpp
+++ b/kdevdesigner/designer/tableeditorimpl.cpp
@@ -26,40 +26,40 @@
#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 <tqlabel.h>
+#include <tqcombobox.h>
+#include <tqheader.h>
+#include <tqlistbox.h>
#include <klineedit.h>
-#include <qpushbutton.h>
+#include <tqpushbutton.h>
#include "pixmapchooser.h"
#include "command.h"
-#include <qvaluelist.h>
-#include <qtabwidget.h>
-#include <qdatatable.h>
+#include <tqvaluelist.h>
+#include <tqtabwidget.h>
+#include <tqdatatable.h>
#include "project.h"
#include "metadatabase.h"
#include "mainwindow.h"
#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( "" );
#ifndef QT_NO_SQL
- if ( !::qt_cast<QDataTable*>(editTable) )
+ if ( !::qt_cast<TQDataTable*>(editTable) )
#endif
{
labelFields->hide();
@@ -68,7 +68,7 @@ TableEditor::TableEditor( QWidget* parent, QWidget *editWidget, FormWindow *fw,
labelTableValue->hide();
}
#ifndef QT_NO_SQL
- if ( ::qt_cast<QDataTable*>(editTable) ) {
+ if ( ::qt_cast<TQDataTable*>(editTable) ) {
// ## why does this behave weird?
// TabWidget->removePage( rows_tab );
// rows_tab->hide();
@@ -76,10 +76,10 @@ TableEditor::TableEditor( QWidget* parent, QWidget *editWidget, FormWindow *fw,
TabWidget->setTabEnabled( rows_tab, FALSE );
}
- if ( formWindow->project() && ::qt_cast<QDataTable*>(editTable) ) {
- QStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList();
+ if ( formWindow->project() && ::qt_cast<TQDataTable*>(editTable) ) {
+ TQStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList();
if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) {
- QStringList fields;
+ TQStringList fields;
fields << "<no field>";
fields += formWindow->project()->databaseFieldList( lst[ 0 ], lst[ 1 ] );
comboFields->insertStringList( fields );
@@ -105,7 +105,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 );
@@ -114,7 +114,7 @@ void TableEditor::columnDownClicked()
currentColumnChanged( i );
}
-void TableEditor::columnTextChanged( const QString &s )
+void TableEditor::columnTextChanged( const TQString &s )
{
if ( listColumns->currentItem() == -1 )
return;
@@ -137,7 +137,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 );
@@ -146,7 +146,7 @@ void TableEditor::columnUpClicked()
currentColumnChanged( i );
}
-void TableEditor::currentColumnChanged( QListBoxItem *i )
+void TableEditor::currentColumnChanged( TQListBoxItem *i )
{
if ( !i )
return;
@@ -159,8 +159,8 @@ void TableEditor::currentColumnChanged( QListBoxItem *i )
editColumnText->blockSignals( FALSE );
#ifndef QT_NO_SQL
- if ( ::qt_cast<QDataTable*>(editTable) ) {
- QString s = *fieldMap.find( listColumns->index( i ) );
+ if ( ::qt_cast<TQDataTable*>(editTable) ) {
+ TQString s = *fieldMap.find( listColumns->index( i ) );
if ( s.isEmpty() )
comboFields->setCurrentItem( 0 );
else if ( comboFields->listBox()->findItem( s ) )
@@ -171,20 +171,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;
@@ -231,20 +231,20 @@ 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 );
#ifndef QT_NO_SQL
- if ( ::qt_cast<QDataTable*>(editTable) ) {
+ if ( ::qt_cast<TQDataTable*>(editTable) ) {
comboFields->setFocus();
} else
#endif
@@ -259,16 +259,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
@@ -287,14 +287,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;
@@ -314,7 +314,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 );
@@ -323,8 +323,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
@@ -354,11 +354,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;
@@ -374,7 +374,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
}
@@ -383,11 +383,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;
@@ -402,7 +402,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
}
@@ -410,9 +410,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 ),
@@ -423,7 +423,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 );
}
@@ -432,7 +432,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 ) ) {
@@ -457,7 +457,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
@@ -470,7 +470,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
@@ -482,13 +482,13 @@ 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 );
}