diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-14 16:45:05 +0000 |
commit | 48d4a26399959121f33d2bc3bfe51c7827b654fc (patch) | |
tree | 5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /languages/cpp/qtdesignercppintegration.cpp | |
parent | 7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff) | |
download | tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip |
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'languages/cpp/qtdesignercppintegration.cpp')
-rw-r--r-- | languages/cpp/qtdesignercppintegration.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/languages/cpp/qtdesignercppintegration.cpp b/languages/cpp/qtdesignercppintegration.cpp index 9314aceb..83354fa8 100644 --- a/languages/cpp/qtdesignercppintegration.cpp +++ b/languages/cpp/qtdesignercppintegration.cpp @@ -40,12 +40,12 @@ #include "codemodel_utils.h" #include "implementationwidget.h" -QtDesignerCppIntegration::QtDesignerCppIntegration( KDevLanguageSupport *part, +TQtDesignerCppIntegration::TQtDesignerCppIntegration( KDevLanguageSupport *part, ImplementationWidget *impl ) -: QtDesignerIntegration( part, impl, true, 0 ) +: TQtDesignerIntegration( part, impl, true, 0 ) {} -void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function function, ClassDom klass ) +void TQtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function function, ClassDom klass ) { m_part->partController() ->editDocument( KURL( klass->fileName() ) ); KTextEditor::EditInterface* editIface = dynamic_cast<KTextEditor::EditInterface*>( m_part->partController() ->activePart() ); @@ -60,7 +60,7 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function klass->getEndPosition( &line, &column ); // compute the insertion point map - TQMap<TQString, QPair<int, int> > points; + TQMap<TQString, TQPair<int, int> > points; const FunctionList functionList = klass->functionList(); for ( FunctionList::ConstIterator it = functionList.begin(); it != functionList.end(); ++it ) @@ -68,9 +68,9 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function int funEndLine, funEndColumn; ( *it ) ->getEndPosition( &funEndLine, &funEndColumn ); TQString access = accessID( *it ); - QPair<int, int> funEndPoint = qMakePair( funEndLine, funEndColumn ); + TQPair<int, int> funEndPoint = tqMakePair( funEndLine, funEndColumn ); - if ( !points.contains( access ) || points[ access ] < funEndPoint ) + if ( !points.tqcontains( access ) || points[ access ] < funEndPoint ) { points[ access ] = funEndPoint; } @@ -78,7 +78,7 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function int insertedLine = 0; - TQString access = function.access + ( function.type == KInterfaceDesigner::ftQtSlot ? " slots" : "" ); + TQString access = function.access + ( function.type == KInterfaceDesigner::ftTQtSlot ? " slots" : "" ); TQString str = function.returnType + " " + function.function; if ( function.specifier == "virtual" ) @@ -90,20 +90,20 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function str += ";\n"; str = " " + str; - QPair<int, int> pt; - if ( points.contains( access ) ) + TQPair<int, int> pt; + if ( points.tqcontains( access ) ) { pt = points[ access ]; } else { str.prepend( access + ":\n" ); - points[ access ] = qMakePair( line - 1, 0 ); + points[ access ] = tqMakePair( line - 1, 0 ); pt = points[ access ]; // end of class declaration } editIface->insertText( pt.first + insertedLine + 1, 0 /*pt.second*/, str ); - insertedLine += str.contains( TQChar( '\n' ) ); + insertedLine += str.tqcontains( TQChar( '\n' ) ); CppSupportPart *cppPart = dynamic_cast<CppSupportPart *>( m_part ); cppPart->backgroundParser() ->addFile( klass->fileName() ); @@ -121,7 +121,7 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function TQFileInfo fi( klass->fileName() ); TQString implementationFile = fi.absFilePath(); - implementationFile.replace( ".h", ".cpp" ); + implementationFile.tqreplace( ".h", ".cpp" ); TQFileInfo fileInfo( implementationFile ); if ( !TQFile::exists( fileInfo.absFilePath() ) ) @@ -158,7 +158,7 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function } else { - if ( editIface->textLine( line ).contains( TQRegExp( ".*#include .*\\.moc.*" ) ) ) + if ( editIface->textLine( line ).tqcontains( TQRegExp( ".*#include .*\\.tqmoc.*" ) ) ) atLine = line; break; } @@ -167,7 +167,7 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function atColumn = 0; } - // editIface->insertLine( atLine + 1, TQString::fromLatin1("") ); + // editIface->insertLine( atLine + 1, TQString::tqfromLatin1("") ); kdDebug() << "at line in intg: " << atLine << " atCol: " << atColumn << endl; kdDebug() << "text: " << stri << endl; editIface->insertText( atLine, atColumn, stri ); @@ -182,35 +182,35 @@ void QtDesignerCppIntegration::addFunctionToClass( KInterfaceDesigner::Function cppPart->backgroundParser() ->addFile( implementationFile ); } -TQString QtDesignerCppIntegration::accessID( FunctionDom fun ) const +TQString TQtDesignerCppIntegration::accessID( FunctionDom fun ) const { if ( fun->isSignal() ) - return TQString::fromLatin1( "signals" ); + return TQString::tqfromLatin1( "signals" ); switch ( fun->access() ) { case CodeModelItem::Public: if ( fun->isSlot() ) - return TQString::fromLatin1( "public slots" ); - return TQString::fromLatin1( "public" ); + return TQString::tqfromLatin1( "public slots" ); + return TQString::tqfromLatin1( "public" ); case CodeModelItem::Protected: if ( fun->isSlot() ) - return TQString::fromLatin1( "protected slots" ); - return TQString::fromLatin1( "protected" ); + return TQString::tqfromLatin1( "protected slots" ); + return TQString::tqfromLatin1( "protected" ); case CodeModelItem::Private: if ( fun->isSlot() ) - return TQString::fromLatin1( "private slots" ); - return TQString::fromLatin1( "private" ); + return TQString::tqfromLatin1( "private slots" ); + return TQString::tqfromLatin1( "private" ); } - return TQString::null; + return TQString(); } -void QtDesignerCppIntegration::processImplementationName( TQString &name ) +void TQtDesignerCppIntegration::processImplementationName( TQString &name ) { - name.replace( ".h", ".cpp" ); + name.tqreplace( ".h", ".cpp" ); } #include "qtdesignercppintegration.moc" |