summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/editfunctionsimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/editfunctionsimpl.cpp')
-rw-r--r--kdevdesigner/designer/editfunctionsimpl.cpp124
1 files changed, 62 insertions, 62 deletions
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 <klineedit.h>
#include "kdevdesigner_part.h"
-#include <qlistview.h>
-#include <qpushbutton.h>
-#include <qcombobox.h>
-#include <qstrlist.h>
-#include <qmessagebox.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qgroupbox.h>
-#include <qheader.h>
-#include <qcheckbox.h>
+#include <tqlistview.h>
+#include <tqpushbutton.h>
+#include <tqcombobox.h>
+#include <tqstrlist.h>
+#include <tqmessagebox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqgroupbox.h>
+#include <tqheader.h>
+#include <tqcheckbox.h>
#include <klocale.h>
-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<MetaDataBase::Function> functionList = MetaDataBase::functionList( fw );
- for ( QValueList<MetaDataBase::Function>::Iterator it = functionList.begin(); it != functionList.end(); ++it ) {
- QListViewItem *i = new QListViewItem( functionListView );
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( fw );
+ for ( TQValueList<MetaDataBase::Function>::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<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow );
- QString n = i18n( "Add/Remove functions of '%1'" ).arg( formWindow->name() );
- QPtrList<Command> commands;
- QValueList<MetaDataBase::Function>::Iterator fit;
+ TQValueList<MetaDataBase::Function> functionList = MetaDataBase::functionList( formWindow );
+ TQString n = i18n( "Add/Remove functions of '%1'" ).arg( formWindow->name() );
+ TQPtrList<Command> commands;
+ TQValueList<MetaDataBase::Function>::Iterator fit;
if ( !functionList.isEmpty() ) {
for ( fit = functionList.begin(); fit != functionList.end(); ++fit ) {
bool functionFound = FALSE;
- QValueList<FunctItem>::Iterator it = functList.begin();
+ TQValueList<FunctItem>::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<FunctItem> invalidItems;
+ TQValueList<FunctItem> invalidItems;
if ( !functList.isEmpty() ) {
- QStrList lst;
- QValueList<FunctItem>::Iterator it = functList.begin();
+ TQStrList lst;
+ TQValueList<FunctItem>::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<FunctItem>::Iterator it = functList.begin();
+ TQValueList<FunctItem>::Iterator it = functList.begin();
while ( it != functList.end() ) {
bool found = FALSE;
- QValueList<FunctItem>::Iterator vit = invalidItems.begin();
+ TQValueList<FunctItem>::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<QListViewItem*, int>::Iterator fit = functionIds.begin();
+ TQMap<TQListViewItem*, int>::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<FunctItem>::Iterator it = functList.begin();
+ TQValueList<FunctItem>::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<QListViewItem*, int>::Iterator fit = functionIds.find( item );
+ TQMap<TQListViewItem*, int>::Iterator fit = functionIds.find( item );
if ( fit != functionIds.end() )
itemId = *fit;
else
return;
- QValueList<FunctItem>::Iterator it = functList.begin();
+ TQValueList<FunctItem>::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<FunctItem>::Iterator it = functList.begin(); it != functList.end(); ++it ) {
+ for ( TQValueList<FunctItem>::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 )
}