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.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/kdevdesigner/designer/tableeditorimpl.cpp b/kdevdesigner/designer/tableeditorimpl.cpp
index d6ebba6c..b95f6bd2 100644
--- a/kdevdesigner/designer/tableeditorimpl.cpp
+++ b/kdevdesigner/designer/tableeditorimpl.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000-2001 Trolltech AS. All rights reserved.
**
-** This file is part of Qt Designer.
+** This file is part of TQt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
@@ -25,7 +25,7 @@
**********************************************************************/
#include "tableeditorimpl.h"
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
#include <tqtable.h>
#endif
#include "formwindow.h"
@@ -46,20 +46,20 @@
#include <klocale.h>
-TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *fw, const char* name, bool modal, WFlags fl )
- : TableEditorBase( parent, name, modal, fl ),
-#ifndef QT_NO_TABLE
+TableEditor::TableEditor( TQWidget* tqparent, TQWidget *editWidget, FormWindow *fw, const char* name, bool modal, WFlags fl )
+ : TableEditorBase( tqparent, name, modal, fl ),
+#ifndef TQT_NO_TABLE
editTable( (TQTable*)editWidget ),
#endif
formWindow( fw )
{
connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
labelColumnPixmap->setText( "" );
labelRowPixmap->setText( "" );
-#ifndef QT_NO_SQL
- if ( !::qt_cast<TQDataTable*>(editTable) )
+#ifndef TQT_NO_SQL
+ if ( !::tqqt_cast<TQDataTable*>(editTable) )
#endif
{
labelFields->hide();
@@ -67,8 +67,8 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
labelTable->hide();
labelTableValue->hide();
}
-#ifndef QT_NO_SQL
- if ( ::qt_cast<TQDataTable*>(editTable) ) {
+#ifndef TQT_NO_SQL
+ if ( ::tqqt_cast<TQDataTable*>(editTable) ) {
// ## why does this behave weird?
// TabWidget->removePage( rows_tab );
// rows_tab->hide();
@@ -76,8 +76,8 @@ TableEditor::TableEditor( TQWidget* parent, TQWidget *editWidget, FormWindow *f
TabWidget->setTabEnabled( rows_tab, FALSE );
}
- if ( formWindow->project() && ::qt_cast<TQDataTable*>(editTable) ) {
- TQStringList lst = MetaDataBase::fakeProperty( editTable, "database" ).toStringList();
+ if ( formWindow->project() && ::tqqt_cast<TQDataTable*>(editTable) ) {
+ TQStringList lst = MetaDataBase::fakeProperty( TQT_TQOBJECT(editTable), "database" ).toStringList();
if ( lst.count() == 2 && !lst[ 0 ].isEmpty() && !lst[ 1 ].isEmpty() ) {
TQStringList fields;
fields << "<no field>";
@@ -121,7 +121,7 @@ void TableEditor::columnTextChanged( const TQString &s )
listColumns->blockSignals( TRUE );
listColumns->changeItem( s, listColumns->currentItem() );
listColumns->blockSignals( FALSE );
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
if ( table->horizontalHeader()->iconSet( listColumns->currentItem() ) )
table->horizontalHeader()->setLabel( listColumns->currentItem(),
*table->horizontalHeader()->iconSet( listColumns->currentItem() ), s );
@@ -158,13 +158,13 @@ void TableEditor::currentColumnChanged( TQListBoxItem *i )
labelColumnPixmap->setText( "" );
editColumnText->blockSignals( FALSE );
-#ifndef QT_NO_SQL
- if ( ::qt_cast<TQDataTable*>(editTable) ) {
- TQString s = *fieldMap.find( listColumns->index( i ) );
+#ifndef TQT_NO_SQL
+ if ( ::tqqt_cast<TQDataTable*>(editTable) ) {
+ TQString s = *fieldMap.tqfind( listColumns->index( i ) );
if ( s.isEmpty() )
comboFields->setCurrentItem( 0 );
- else if ( comboFields->listBox()->findItem( s ) )
- comboFields->setCurrentItem( comboFields->listBox()->index( comboFields->listBox()->findItem( s ) ) );
+ else if ( comboFields->listBox()->tqfindItem( s ) )
+ comboFields->setCurrentItem( comboFields->listBox()->index( comboFields->listBox()->tqfindItem( s ) ) );
else
comboFields->lineEdit()->setText( s );
}
@@ -201,7 +201,7 @@ void TableEditor::deleteColumnClicked()
{
if ( listColumns->currentItem() == -1 )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->setNumCols( table->numCols() - 1 );
delete listColumns->item( listColumns->currentItem() );
readColumns();
@@ -216,7 +216,7 @@ void TableEditor::deleteRowClicked()
{
if ( listRows->currentItem() == -1 )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->setNumRows( table->numRows() - 1 );
delete listRows->item( listRows->currentItem() );
readRows();
@@ -229,22 +229,22 @@ void TableEditor::deleteRowClicked()
void TableEditor::newColumnClicked()
{
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->setNumCols( table->numCols() + 1 );
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;
TQString t = TQString::number( n );
- while ( m.find( t ) != m.end() )
+ while ( m.tqfind( t ) != m.end() )
t = TQString::number( ++n );
table->horizontalHeader()->setLabel( table->numCols() - 1, t );
listColumns->insertItem( t );
TQListBoxItem *item = listColumns->item( listColumns->count() - 1 );
listColumns->setCurrentItem( item );
listColumns->setSelected( item, TRUE );
-#ifndef QT_NO_SQL
- if ( ::qt_cast<TQDataTable*>(editTable) ) {
+#ifndef TQT_NO_SQL
+ if ( ::tqqt_cast<TQDataTable*>(editTable) ) {
comboFields->setFocus();
} else
#endif
@@ -257,14 +257,14 @@ void TableEditor::newColumnClicked()
void TableEditor::newRowClicked()
{
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->setNumRows( table->numRows() + 1 );
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;
TQString t = TQString::number( n );
- while ( m.find( t ) != m.end() )
+ while ( m.tqfind( t ) != m.end() )
t = TQString::number( ++n );
table->verticalHeader()->setLabel( table->numRows() - 1, t );
listRows->insertItem( t );
@@ -298,7 +298,7 @@ void TableEditor::rowTextChanged( const TQString &s )
{
if ( listRows->currentItem() == -1 )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
listRows->changeItem( s, listRows->currentItem() );
if ( table->verticalHeader()->iconSet( listRows->currentItem() ) )
table->verticalHeader()->setLabel( listRows->currentItem(),
@@ -327,13 +327,13 @@ void TableEditor::applyClicked()
TQValueList<PopulateTableCommand::Column> cols;
int i = 0;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
for ( i = 0; i < table->horizontalHeader()->count(); ++i ) {
PopulateTableCommand::Column col;
col.text = table->horizontalHeader()->label( i );
if ( table->horizontalHeader()->iconSet( i ) )
col.pix = table->horizontalHeader()->iconSet( i )->pixmap();
- col.field = *fieldMap.find( i );
+ col.field = *fieldMap.tqfind( i );
cols.append( col );
}
for ( i = 0; i < table->verticalHeader()->count(); ++i ) {
@@ -343,7 +343,7 @@ void TableEditor::applyClicked()
row.pix = table->verticalHeader()->iconSet( i )->pixmap();
rows.append( row );
}
- PopulateTableCommand *cmd = new PopulateTableCommand( i18n( "Edit the Rows and Columns of '%1' " ).arg( editTable->name() ),
+ PopulateTableCommand *cmd = new PopulateTableCommand( i18n( "Edit the Rows and Columns of '%1' " ).tqarg( editTable->name() ),
formWindow, editTable, rows, cols );
cmd->execute();
formWindow->commandHistory()->addCommand( cmd );
@@ -363,7 +363,7 @@ void TableEditor::chooseRowPixmapClicked()
if ( pix.isNull() )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->verticalHeader()->setLabel( listRows->currentItem(), pix, table->verticalHeader()->label( listRows->currentItem() ) );
listRows->changeItem( pix, listRows->currentText(), listRows->currentItem() );
#endif
@@ -373,7 +373,7 @@ void TableEditor::deleteRowPixmapClicked()
{
if ( listRows->currentItem() == -1 )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->verticalHeader()->setLabel( listRows->currentItem(), TQPixmap(), table->verticalHeader()->label( listRows->currentItem() ) );
listRows->changeItem( listRows->currentText(), listRows->currentItem() );
#endif
@@ -391,7 +391,7 @@ void TableEditor::chooseColPixmapClicked()
if ( pix.isNull() )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->horizontalHeader()->setLabel( listColumns->currentItem(), pix, table->horizontalHeader()->label( listColumns->currentItem() ) );
listColumns->changeItem( pix, listColumns->currentText(), listColumns->currentItem() );
#endif
@@ -401,7 +401,7 @@ void TableEditor::deleteColPixmapClicked()
{
if ( listColumns->currentItem() == -1 )
return;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
table->horizontalHeader()->setLabel( listColumns->currentItem(), TQPixmap(), table->horizontalHeader()->label( listColumns->currentItem() ) );
listColumns->changeItem( listColumns->currentText(), listColumns->currentItem() );
#endif
@@ -409,10 +409,10 @@ void TableEditor::deleteColPixmapClicked()
void TableEditor::readFromTable()
{
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
TQHeader *cols = editTable->horizontalHeader();
table->setNumCols( cols->count() );
- TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( editTable );
+ TQMap<TQString, TQString> columnFields = MetaDataBase::columnFields( TQT_TQOBJECT(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 ) );
}
- TQString cf = *columnFields.find( editTable->horizontalHeader()->label( i ) );
+ TQString cf = *columnFields.tqfind( editTable->horizontalHeader()->label( i ) );
fieldMap.insert( i, cf );
}
@@ -456,7 +456,7 @@ void TableEditor::readFromTable()
void TableEditor::readColumns()
{
int j = 0;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
for ( TQListBoxItem *i = listColumns->firstItem(); i; i = i->next(), ++j ) {
if ( i->pixmap() )
table->horizontalHeader()->setLabel( j, *i->pixmap(), i->text() );
@@ -469,7 +469,7 @@ void TableEditor::readColumns()
void TableEditor::readRows()
{
int j = 0;
-#ifndef QT_NO_TABLE
+#ifndef TQT_NO_TABLE
for ( TQListBoxItem *i = listRows->firstItem(); i; i = i->next(), ++j ) {
if ( i->pixmap() )
table->verticalHeader()->setLabel( j, *i->pixmap(), i->text() );