From d6f8bbb45b267065a6907e71ff9c98bb6d161241 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:56:07 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kdevdesigner/designer/editfunctionsimpl.cpp | 124 ++++++++++++++-------------- 1 file changed, 62 insertions(+), 62 deletions(-) (limited to 'kdevdesigner/designer/editfunctionsimpl.cpp') diff --git a/kdevdesigner/designer/editfunctionsimpl.cpp b/kdevdesigner/designer/editfunctionsimpl.cpp index 19506e22..fd773bd0 100644 --- a/kdevdesigner/designer/editfunctionsimpl.cpp +++ b/kdevdesigner/designer/editfunctionsimpl.cpp @@ -36,30 +36,30 @@ #include #include "kdevdesigner_part.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -EditFunctions::EditFunctions( QWidget *parent, FormWindow *fw, bool justSlots ) +EditFunctions::EditFunctions( TQWidget *parent, FormWindow *fw, bool justSlots ) : EditFunctionsBase( parent, 0, TRUE ), formWindow( fw ) { - connect( helpButton, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) ); + connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) ); id = 0; functList.clear(); - QValueList functionList = MetaDataBase::functionList( fw ); - for ( QValueList::Iterator it = functionList.begin(); it != functionList.end(); ++it ) { - QListViewItem *i = new QListViewItem( functionListView ); + TQValueList functionList = MetaDataBase::functionList( fw ); + for ( TQValueList::Iterator it = functionList.begin(); it != functionList.end(); ++it ) { + TQListViewItem *i = new TQListViewItem( functionListView ); i->setPixmap( 0, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()) ); i->setText( 0, (*it).function ); @@ -105,40 +105,40 @@ EditFunctions::EditFunctions( QWidget *parent, FormWindow *fw, bool justSlots ) lastType = "function"; // Enable rename for all QListViewItems - QListViewItemIterator lvit = functionListView->firstChild(); + TQListViewItemIterator lvit = functionListView->firstChild(); for ( ; *lvit; lvit++ ) (*lvit)->setRenameEnabled( 0, TRUE ); // Connect listview signal to signal-relay - QObject::connect( functionListView, - SIGNAL( itemRenamed( QListViewItem*, int, const QString & ) ), + TQObject::connect( functionListView, + TQT_SIGNAL( itemRenamed( TQListViewItem*, int, const TQString & ) ), this, - SLOT( emitItemRenamed(QListViewItem*, int, const QString&) ) ); + TQT_SLOT( emitItemRenamed(TQListViewItem*, int, const TQString&) ) ); - // Connect signal-relay to QLineEdit "functionName" - QObjectList *l = parent->queryList( "QLineEdit", "functionName" ); - QObject *obj; - QObjectListIt itemsLineEditIt( *l ); + // Connect signal-relay to TQLineEdit "functionName" + TQObjectList *l = parent->queryList( "TQLineEdit", "functionName" ); + TQObject *obj; + TQObjectListIt itemsLineEditIt( *l ); while ( (obj = itemsLineEditIt.current()) != 0 ) { ++itemsLineEditIt; - QObject::connect( this, - SIGNAL( itemRenamed( const QString & ) ), + TQObject::connect( this, + TQT_SIGNAL( itemRenamed( const TQString & ) ), obj, - SLOT( setText( const QString & ) ) ); + TQT_SLOT( setText( const TQString & ) ) ); } delete l; } void EditFunctions::okClicked() { - QValueList functionList = MetaDataBase::functionList( formWindow ); - QString n = i18n( "Add/Remove functions of '%1'" ).arg( formWindow->name() ); - QPtrList commands; - QValueList::Iterator fit; + TQValueList functionList = MetaDataBase::functionList( formWindow ); + TQString n = i18n( "Add/Remove functions of '%1'" ).arg( formWindow->name() ); + TQPtrList commands; + TQValueList::Iterator fit; if ( !functionList.isEmpty() ) { for ( fit = functionList.begin(); fit != functionList.end(); ++fit ) { bool functionFound = FALSE; - QValueList::Iterator it = functList.begin(); + TQValueList::Iterator it = functList.begin(); for ( ; it != functList.end(); ++it ) { if ( MetaDataBase::normalizeFunction( (*it).oldName ) == MetaDataBase::normalizeFunction( (*fit).function ) ) { @@ -157,11 +157,11 @@ void EditFunctions::okClicked() } bool invalidFunctions = FALSE; - QValueList invalidItems; + TQValueList invalidItems; if ( !functList.isEmpty() ) { - QStrList lst; - QValueList::Iterator it = functList.begin(); + TQStrList lst; + TQValueList::Iterator it = functList.begin(); for ( ; it != functList.end(); ++it ) { MetaDataBase::Function function; function.function = (*it).newName; @@ -172,7 +172,7 @@ void EditFunctions::okClicked() function.language = formWindow->project()->language(); if ( function.returnType.isEmpty() ) function.returnType = "void"; - QString s = function.function; + TQString s = function.function; s = s.simplifyWhiteSpace(); bool startNum = s[ 0 ] >= '0' && s[ 0 ] <= '9'; bool noParens = s.contains( '(' ) != 1 || s.contains( ')' ) != 1; @@ -200,7 +200,7 @@ void EditFunctions::okClicked() if ( MetaDataBase::normalizeFunction( (*it).newName ) != MetaDataBase::normalizeFunction( (*it).oldName ) || (*it).spec != (*it).oldSpec || (*it).access != (*it).oldAccess || (*it).type != (*it).oldType || (*it).retTyp != (*it).oldRetTyp ) { - QString normalizedOldName = MetaDataBase::normalizeFunction( (*it).oldName ); + TQString normalizedOldName = MetaDataBase::normalizeFunction( (*it).oldName ); if ((*it).oldName.endsWith("const")) // make sure we get the 'const' when we remove the old name normalizedOldName += " const"; commands.append( new ChangeFunctionAttribCommand( i18n( "Change Function Attributes" ), @@ -213,13 +213,13 @@ void EditFunctions::okClicked() } if ( invalidFunctions ) { - if ( QMessageBox::information( this, i18n( "Edit Functions" ), + if ( TQMessageBox::information( this, i18n( "Edit Functions" ), i18n( "Some syntactically incorrect functions have been defined.\n" "Remove these functions?" ), i18n( "&Yes" ), i18n( "&No" ) ) == 0 ) { - QValueList::Iterator it = functList.begin(); + TQValueList::Iterator it = functList.begin(); while ( it != functList.end() ) { bool found = FALSE; - QValueList::Iterator vit = invalidItems.begin(); + TQValueList::Iterator vit = invalidItems.begin(); for ( ; vit != invalidItems.end(); ++vit ) { if ( (*vit).newName == (*it).newName ) { invalidItems.remove( vit ); @@ -230,10 +230,10 @@ void EditFunctions::okClicked() if ( found ) { int delId = (*it).id; it = functList.remove( it ); - QMap::Iterator fit = functionIds.begin(); + TQMap::Iterator fit = functionIds.begin(); while ( fit != functionIds.end() ) { if ( *fit == delId ) { - QListViewItem *litem = fit.key(); + TQListViewItem *litem = fit.key(); functionIds.remove( fit ); delete litem; if ( functionListView->currentItem() ) @@ -266,9 +266,9 @@ void EditFunctions::okClicked() accept(); } -void EditFunctions::functionAdd( const QString &access, const QString &type ) +void EditFunctions::functionAdd( const TQString &access, const TQString &type ) { - QListViewItem *i = new QListViewItem( functionListView ); + TQListViewItem *i = new TQListViewItem( functionListView ); i->setPixmap( 0, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()) ); i->setRenameEnabled( 0, TRUE ); i->setText( 1, "void" ); @@ -332,7 +332,7 @@ void EditFunctions::functionRemove() functionListView->blockSignals( TRUE ); removedFunctions << MetaDataBase::normalizeFunction( functionListView->currentItem()->text( 0 ) ); int delId = functionIds[ functionListView->currentItem() ]; - QValueList::Iterator it = functList.begin(); + TQValueList::Iterator it = functList.begin(); while ( it != functList.end() ) { if ( (*it).id == delId ) { functList.remove( it ); @@ -348,7 +348,7 @@ void EditFunctions::functionRemove() currentItemChanged( functionListView->currentItem() ); } -void EditFunctions::currentItemChanged( QListViewItem *i ) +void EditFunctions::currentItemChanged( TQListViewItem *i ) { functionName->blockSignals( TRUE ); functionName->setText( "" ); @@ -363,9 +363,9 @@ void EditFunctions::currentItemChanged( QListViewItem *i ) functionName->blockSignals( TRUE ); functionName->setText( i->text( 0 ) ); editType->setText( i->text( 1 ) ); - QString specifier = i->text( 2 ); - QString access = i->text( 3 ); - QString type = i->text( 4 ); + TQString specifier = i->text( 2 ); + TQString access = i->text( 3 ); + TQString type = i->text( 4 ); if ( specifier == "pure virtual" ) functionSpecifier->setCurrentItem( 2 ); else if ( specifier == "non virtual" ) @@ -389,7 +389,7 @@ void EditFunctions::currentItemChanged( QListViewItem *i ) boxProperties->setEnabled( TRUE ); } -void EditFunctions::currentTextChanged( const QString &txt ) +void EditFunctions::currentTextChanged( const TQString &txt ) { if ( !functionListView->currentItem() ) return; @@ -407,7 +407,7 @@ void EditFunctions::currentTextChanged( const QString &txt ) } } -void EditFunctions::currentSpecifierChanged( const QString& s ) +void EditFunctions::currentSpecifierChanged( const TQString& s ) { if ( !functionListView->currentItem() ) return; @@ -416,7 +416,7 @@ void EditFunctions::currentSpecifierChanged( const QString& s ) functionListView->currentItem()->setText( 2, s ); } -void EditFunctions::currentAccessChanged( const QString& a ) +void EditFunctions::currentAccessChanged( const TQString& a ) { if ( !functionListView->currentItem() ) return; @@ -425,7 +425,7 @@ void EditFunctions::currentAccessChanged( const QString& a ) } -void EditFunctions::currentReturnTypeChanged( const QString &type ) +void EditFunctions::currentReturnTypeChanged( const TQString &type ) { if ( !functionListView->currentItem() ) return; @@ -433,7 +433,7 @@ void EditFunctions::currentReturnTypeChanged( const QString &type ) functionListView->currentItem()->setText( 1, type ); } -void EditFunctions::currentTypeChanged( const QString &type ) +void EditFunctions::currentTypeChanged( const TQString &type ) { if ( !functionListView->currentItem() ) return; @@ -451,16 +451,16 @@ void EditFunctions::currentTypeChanged( const QString &type ) } } -void EditFunctions::changeItem( QListViewItem *item, Attribute a, const QString &nV ) +void EditFunctions::changeItem( TQListViewItem *item, Attribute a, const TQString &nV ) { int itemId; - QMap::Iterator fit = functionIds.find( item ); + TQMap::Iterator fit = functionIds.find( item ); if ( fit != functionIds.end() ) itemId = *fit; else return; - QValueList::Iterator it = functList.begin(); + TQValueList::Iterator it = functList.begin(); for ( ; it != functList.end(); ++it ) { if ( (*it).id == itemId ) { switch( a ) { @@ -484,9 +484,9 @@ void EditFunctions::changeItem( QListViewItem *item, Attribute a, const QString } } -void EditFunctions::setCurrentFunction( const QString &function ) +void EditFunctions::setCurrentFunction( const TQString &function ) { - QListViewItemIterator it( functionListView ); + TQListViewItemIterator it( functionListView ); while ( it.current() ) { if ( MetaDataBase::normalizeFunction( it.current()->text( 0 ) ) == function ) { functionListView->setCurrentItem( it.current() ); @@ -502,10 +502,10 @@ void EditFunctions::displaySlots( bool justSlots ) { functionIds.clear(); functionListView->clear(); - for ( QValueList::Iterator it = functList.begin(); it != functList.end(); ++it ) { + for ( TQValueList::Iterator it = functList.begin(); it != functList.end(); ++it ) { if ( (*it).type == "function" && justSlots ) continue; - QListViewItem *i = new QListViewItem( functionListView ); + TQListViewItem *i = new TQListViewItem( functionListView ); functionIds.insert( i, (*it).id ); i->setPixmap( 0, SmallIcon( "designer_editslots.png" , KDevDesignerPartFactory::instance()) ); i->setText( 0, (*it).newName ); @@ -528,7 +528,7 @@ void EditFunctions::displaySlots( bool justSlots ) functionListView->setSelected( functionListView->firstChild(), TRUE ); } -void EditFunctions::emitItemRenamed( QListViewItem *, int, const QString & text ) +void EditFunctions::emitItemRenamed( TQListViewItem *, int, const TQString & text ) { - emit itemRenamed( text ); // Relay signal ( to QLineEdit ) + emit itemRenamed( text ); // Relay signal ( to TQLineEdit ) } -- cgit v1.2.3