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 --- languages/cpp/addattributedialog.cpp | 92 ++++++++++++++++++------------------ 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'languages/cpp/addattributedialog.cpp') diff --git a/languages/cpp/addattributedialog.cpp b/languages/cpp/addattributedialog.cpp index 7f5712a2..42031f59 100644 --- a/languages/cpp/addattributedialog.cpp +++ b/languages/cpp/addattributedialog.cpp @@ -32,24 +32,24 @@ #include #include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include AddAttributeDialog::AddAttributeDialog( CppSupportPart* cppSupport, ClassDom klass, - QWidget* parent, const char* name, bool modal, WFlags fl ) + TQWidget* parent, const char* name, bool modal, WFlags fl ) : AddAttributeDialogBase( parent, name, modal, fl ), m_cppSupport( cppSupport ), m_klass( klass ), m_count( 0 ) { - access->insertStringList( QStringList() << "Public" << "Protected" << "Private" ); + access->insertStringList( TQStringList() << "Public" << "Protected" << "Private" ); - storage->insertStringList( QStringList() << "Normal" << "Static" ); + storage->insertStringList( TQStringList() << "Normal" << "Static" ); returnType->setAutoCompletion( true ); - returnType->insertStringList( QStringList() + returnType->insertStringList( TQStringList() << "void" << "char" << "wchar_t" @@ -73,7 +73,7 @@ AddAttributeDialog::~AddAttributeDialog() void AddAttributeDialog::reject() { - QDialog::reject(); + TQDialog::reject(); } void AddAttributeDialog::accept() @@ -83,7 +83,7 @@ void AddAttributeDialog::accept() if ( !editIface ) { /// @todo show messagebox - QDialog::accept(); + TQDialog::accept(); return ; } @@ -91,15 +91,15 @@ void AddAttributeDialog::accept() m_klass->getEndPosition( &line, &column ); // compute the insertion point map - QMap > points; - QStringList accessList; + TQMap > points; + TQStringList accessList; const VariableList variableList = m_klass->variableList(); for ( VariableList::ConstIterator it = variableList.begin(); it != variableList.end(); ++it ) { int varEndLine, varEndColumn; ( *it ) ->getEndPosition( &varEndLine, &varEndColumn ); - QString access = accessID( *it ); + TQString access = accessID( *it ); QPair varEndPoint = qMakePair( varEndLine, varEndColumn ); if ( !points.contains( access ) || points[ access ] < varEndPoint ) @@ -115,21 +115,21 @@ void AddAttributeDialog::accept() accessList += newAccessList( accessList ); - for ( QStringList::iterator it = accessList.begin(); it != accessList.end(); ++it ) + for ( TQStringList::iterator it = accessList.begin(); it != accessList.end(); ++it ) { - QListViewItem* item = attributes->firstChild(); + TQListViewItem* item = attributes->firstChild(); while ( item ) { - QListViewItem * currentItem = item; + TQListViewItem * currentItem = item; item = item->nextSibling(); if ( currentItem->text( 0 ) != *it ) continue; - QString access = ( *it ).lower(); + TQString access = ( *it ).lower(); - QString str = variableDeclaration( currentItem ); + TQString str = variableDeclaration( currentItem ); QPair pt; if ( points.contains( *it ) ) @@ -144,21 +144,21 @@ void AddAttributeDialog::accept() } editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str ); - insertedLine += str.contains( QChar( '\n' ) ); + insertedLine += str.contains( TQChar( '\n' ) ); } } m_cppSupport->backgroundParser() ->addFile( m_klass->fileName() ); - QDialog::accept(); + TQDialog::accept(); } -QString AddAttributeDialog::variableDeclaration( QListViewItem* item ) const +TQString AddAttributeDialog::variableDeclaration( TQListViewItem* item ) const { - QString str; - QTextStream stream( &str, IO_WriteOnly ); - QString ind; - ind.fill( QChar( ' ' ), 4 ); + TQString str; + TQTextStream stream( &str, IO_WriteOnly ); + TQString ind; + ind.fill( TQChar( ' ' ), 4 ); stream << ind; if ( item->text( 1 ) == "Static" ) @@ -183,7 +183,7 @@ void AddAttributeDialog::updateGUI() if ( enable ) { - QListViewItem * item = attributes->selectedItem(); + TQListViewItem * item = attributes->selectedItem(); item->setText( 0, access->currentText() ); item->setText( 1, storage->currentText() ); item->setText( 2, returnType->currentText() ); @@ -193,8 +193,8 @@ void AddAttributeDialog::updateGUI() void AddAttributeDialog::addAttribute() { - QListViewItem * item = new QListViewItem( attributes, "Protected", "Normal", - "int", QString( "attribute_%1" ).arg( ++m_count ) ); + TQListViewItem * item = new TQListViewItem( attributes, "Protected", "Normal", + "int", TQString( "attribute_%1" ).arg( ++m_count ) ); attributes->setCurrentItem( item ); attributes->setSelected( item, true ); @@ -206,14 +206,14 @@ void AddAttributeDialog::deleteCurrentAttribute() delete( attributes->currentItem() ); } -void AddAttributeDialog::currentChanged( QListViewItem* item ) +void AddAttributeDialog::currentChanged( TQListViewItem* item ) { if ( item ) { - QString _access = item->text( 0 ); - QString _storage = item->text( 1 ); - QString _returnType = item->text( 2 ); - QString _declarator = item->text( 3 ); + TQString _access = item->text( 0 ); + TQString _storage = item->text( 1 ); + TQString _returnType = item->text( 2 ); + TQString _declarator = item->text( 3 ); access->setCurrentText( _access ); storage->setCurrentText( _storage ); @@ -224,18 +224,18 @@ void AddAttributeDialog::currentChanged( QListViewItem* item ) updateGUI(); } -QStringList AddAttributeDialog::newAccessList( const QStringList& accessList ) const +TQStringList AddAttributeDialog::newAccessList( const TQStringList& accessList ) const { - QStringList newAccessList; + TQStringList newAccessList; - QListViewItem* item = attributes->firstChild(); + TQListViewItem* item = attributes->firstChild(); while ( item ) { - QListViewItem * currentItem = item; + TQListViewItem * currentItem = item; item = item->nextSibling(); - QString access = currentItem->text( 0 ); + TQString access = currentItem->text( 0 ); if ( !( accessList.contains( access ) || newAccessList.contains( access ) ) ) newAccessList.push_back( access ); } @@ -243,21 +243,21 @@ QStringList AddAttributeDialog::newAccessList( const QStringList& accessList ) c return newAccessList; } -QString AddAttributeDialog::accessID( VariableDom var ) const +TQString AddAttributeDialog::accessID( VariableDom var ) const { switch ( var->access() ) { case CodeModelItem::Public: - return QString::fromLatin1( "Public" ); + return TQString::fromLatin1( "Public" ); case CodeModelItem::Protected: - return QString::fromLatin1( "Protected" ); + return TQString::fromLatin1( "Protected" ); case CodeModelItem::Private: - return QString::fromLatin1( "Private" ); + return TQString::fromLatin1( "Private" ); } - return QString::null; + return TQString::null; } #include "addattributedialog.moc" -- cgit v1.2.1