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/pcsimporter/qt4importer | |
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/pcsimporter/qt4importer')
5 files changed, 57 insertions, 55 deletions
diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp index d4635ba4..5864659c 100644 --- a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp +++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.cpp @@ -22,15 +22,15 @@ #include <tqlabel.h> #include <tqdir.h> -K_EXPORT_COMPONENT_FACTORY( libkdevqt4importer, KGenericFactory<KDevQt4Importer>( "kdevqt4importer" ) ) +K_EXPORT_COMPONENT_FACTORY( libkdevqt4importer, KGenericFactory<KDevTQt4Importer>( "kdevqt4importer" ) ) -KDevQt4Importer::KDevQt4Importer( TQObject * parent, const char * name, const TQStringList& ) - : KDevPCSImporter( parent, name ) +KDevTQt4Importer::KDevTQt4Importer( TQObject * tqparent, const char * name, const TQStringList& ) + : KDevPCSImporter( tqparent, name ) { m_qtfile = 0; } -KDevQt4Importer::~KDevQt4Importer() +KDevTQt4Importer::~KDevTQt4Importer() { if (m_qtfile) delete m_qtfile; @@ -38,7 +38,7 @@ KDevQt4Importer::~KDevQt4Importer() m_qtfile = 0; } -TQStringList KDevQt4Importer::fileList() +TQStringList KDevTQt4Importer::fileList() { if( !m_settings ) return TQStringList(); @@ -49,18 +49,18 @@ TQStringList KDevQt4Importer::fileList() KTempFile ifile; TQTextStream &is = *ifile.textStream(); - is << "#include <QtCore/qobjectdefs.h>\n" - << "#undef Q_SLOTS\n#undef Q_SIGNALS\n#undef slots\n#undef signals" - << "#define Q_SLOTS slots\n" - << "#define Q_SIGNALS signals\n" - << "#include <QtCore/QtCore>\n" - << "#include <QtGui/QtGui>\n" - << "#include <QtNetwork/QtNetwork>\n" - << "#include <QtXml/QtXml>\n" - << "#include <Qt3Support/Qt3Support>\n" - << "#include <QtSql/QtSql>\n" - << "#include <QtTest/QtTest>\n" - << "#include <QtOpenGL/QtOpenGL>\n"; + is << "#include <TQtCore/tqobjectdefs.h>\n" + << "#undef slots\n#undef signals\n#undef slots\n#undef signals" + << "#define slots slots\n" + << "#define signals signals\n" + << "#include <TQtCore/TQtCore>\n" + << "#include <TQtGui/TQtGui>\n" + << "#include <TQtNetwork/TQtNetwork>\n" + << "#include <TQtXml/TQtXml>\n" + << "#include <TQt3Support/TQt3Support>\n" + << "#include <TQtSql/TQtSql>\n" + << "#include <TQtTest/TQtTest>\n" + << "#include <TQtOpenGL/TQtOpenGL>\n"; @@ -86,22 +86,22 @@ TQStringList KDevQt4Importer::fileList() return m_qtfile->name(); } -TQStringList KDevQt4Importer::includePaths() +TQStringList KDevTQt4Importer::includePaths() { if( !m_settings || !m_qtfile) return TQStringList(); TQStringList includePaths; includePaths.push_back( m_settings->qtDir() ); - includePaths.push_back( m_settings->qtDir() + "/Qt" ); + includePaths.push_back( m_settings->qtDir() + "/TQt" ); /// @todo add mkspec return includePaths; } -TQWidget * KDevQt4Importer::createSettingsPage( TQWidget * parent, const char * name ) +TQWidget * KDevTQt4Importer::createSettingsPage( TQWidget * tqparent, const char * name ) { - m_settings = new SettingsDialog( parent, name ); + m_settings = new SettingsDialog( tqparent, name ); return m_settings; } diff --git a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h index c430db19..5a365bf6 100644 --- a/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h +++ b/languages/cpp/pcsimporter/qt4importer/kdevqt4importer.h @@ -9,8 +9,8 @@ * * ***************************************************************************/ -#ifndef KDEVQTIMPORTER_H -#define KDEVQTIMPORTER_H +#ifndef KDEVTQTIMPORTER_H +#define KDEVTQTIMPORTER_H #include <kdevpcsimporter.h> #include <tqguardedptr.h> @@ -18,18 +18,19 @@ class SettingsDialog; class KTempFile; -class KDevQt4Importer : public KDevPCSImporter +class KDevTQt4Importer : public KDevPCSImporter { Q_OBJECT + TQ_OBJECT public: - KDevQt4Importer( TQObject* parent=0, const char* name=0, const TQStringList& args=TQStringList() ); - virtual ~KDevQt4Importer(); + KDevTQt4Importer( TQObject* tqparent=0, const char* name=0, const TQStringList& args=TQStringList() ); + virtual ~KDevTQt4Importer(); - virtual TQString dbName() const { return TQString::fromLatin1("Qt4"); } + virtual TQString dbName() const { return TQString::tqfromLatin1("TQt4"); } virtual TQStringList fileList(); virtual TQStringList includePaths(); - virtual TQWidget* createSettingsPage( TQWidget* parent, const char* name=0 ); + virtual TQWidget* createSettingsPage( TQWidget* tqparent, const char* name=0 ); private: TQGuardedPtr<SettingsDialog> m_settings; diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp b/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp index 755b14c4..1b8e46f2 100644 --- a/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp +++ b/languages/cpp/pcsimporter/qt4importer/settingsdialog.cpp @@ -27,20 +27,20 @@ #include "settingsdialog.h" -TQListBoxItem* QListBox_selectedItem(TQListBox* cpQListBox) +TQListBoxItem* TQListBox_selectedItem(TQListBox* cpTQListBox) { - if ( cpQListBox->selectionMode() != TQListBox::Single ) + if ( cpTQListBox->selectionMode() != TQListBox::Single ) return 0; - if ( cpQListBox->isSelected( cpQListBox->currentItem() ) ) - return cpQListBox->item(cpQListBox->currentItem()); + if ( cpTQListBox->isSelected( cpTQListBox->currentItem() ) ) + return cpTQListBox->item(cpTQListBox->currentItem()); return 0; } -SettingsDialog::SettingsDialog(TQWidget* parent, const char* name, WFlags fl) - : SettingsDialogBase(parent,name,fl) +SettingsDialog::SettingsDialog(TQWidget* tqparent, const char* name, WFlags fl) + : SettingsDialogBase(tqparent,name,fl) { TQStringList qtdirs; - qtdirs.push_back( ::getenv("QTDIR") + TQString("/include") ); + qtdirs.push_back( ::getenv("TQTDIR") + TQString("/include") ); qtdirs.push_back( TQString::fromLocal8Bit(::getenv("HOME")) + "/dev/qt/include" ); qtdirs.push_back( TQString::fromLocal8Bit(::getenv("HOME")) + "/dev/qt-main/include" ); qtdirs.push_back( "/usr/qt/4/include" ); @@ -48,8 +48,8 @@ SettingsDialog::SettingsDialog(TQWidget* parent, const char* name, WFlags fl) for( TQStringList::Iterator it=qtdirs.begin(); it!=qtdirs.end(); ++it ) { TQString qtdir = *it; - if( !qtdir.isEmpty() && isValidQtDir(qtdir) ) - if (!qtListBox->findItem(qtdir, ExactMatch)) + if( !qtdir.isEmpty() && isValidTQtDir(qtdir) ) + if (!qtListBox->tqfindItem(qtdir, ExactMatch)) qtListBox->insertItem( qtdir ); } @@ -74,9 +74,9 @@ void SettingsDialog::slotSelectionChanged(TQListBoxItem* item) emit enabled( true ); } -bool SettingsDialog::isValidQtDir( const TQString & path ) const +bool SettingsDialog::isValidTQtDir( const TQString & path ) const { - return TQFile::exists( path + "/QtCore/QtCore" ); + return TQFile::exists( path + "/TQtCore/TQtCore" ); } TQString SettingsDialog::qtDir( ) const @@ -93,10 +93,10 @@ void SettingsDialog::addUrlButton_clicked( ) { kdDebug(9000) << k_funcinfo << endl; - if ( isValidQtDir( qtUrl->url() ) ) + if ( isValidTQtDir( qtUrl->url() ) ) { qtListBox->insertItem( qtUrl->url() ); - if ( TQListBoxItem * item = qtListBox->findItem( qtUrl->url(), ExactMatch ) ) + if ( TQListBoxItem * item = qtListBox->tqfindItem( qtUrl->url(), ExactMatch ) ) { qtListBox->setSelected( item, true ); } @@ -104,7 +104,7 @@ void SettingsDialog::addUrlButton_clicked( ) } else { - KMessageBox::error( this, i18n("This does not appear to be a valid Qt4 include directory.\nPlease select a different directory."), i18n("Invalid Directory") ); + KMessageBox::error( this, i18n("This does not appear to be a valid TQt4 include directory.\nPlease select a different directory."), i18n("Invalid Directory") ); } } diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialog.h b/languages/cpp/pcsimporter/qt4importer/settingsdialog.h index 118564fb..9a28b2ad 100644 --- a/languages/cpp/pcsimporter/qt4importer/settingsdialog.h +++ b/languages/cpp/pcsimporter/qt4importer/settingsdialog.h @@ -17,13 +17,14 @@ class SettingsDialog : public SettingsDialogBase { Q_OBJECT + TQ_OBJECT public: - SettingsDialog(TQWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + SettingsDialog(TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0 ); ~SettingsDialog(); /*$PUBLIC_FUNCTIONS$*/ - bool isValidQtDir( const TQString& path ) const; + bool isValidTQtDir( const TQString& path ) const; TQString qtDir() const; TQString configuration() const; diff --git a/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui b/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui index f655e4f9..d3314b40 100644 --- a/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui +++ b/languages/cpp/pcsimporter/qt4importer/settingsdialogbase.ui @@ -1,6 +1,6 @@ <!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <class>SettingsDialogBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>SettingsDialogBase</cstring> </property> @@ -16,7 +16,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -25,7 +25,7 @@ Only the selected entry will be used</string> </property> </widget> - <widget class="QPushButton" row="2" column="1"> + <widget class="TQPushButton" row="2" column="1"> <property name="name"> <cstring>addUrlButton</cstring> </property> @@ -58,18 +58,18 @@ Only the selected entry will be used</string> <connections> <connection> <sender>qtListBox</sender> - <signal>selectionChanged(QListBoxItem*)</signal> + <signal>selectionChanged(TQListBoxItem*)</signal> <receiver>SettingsDialogBase</receiver> - <slot>slotSelectionChanged(QListBoxItem*)</slot> + <slot>slotSelectionChanged(TQListBoxItem*)</slot> </connection> </connections> -<signals> +<Q_SIGNALS> <signal>enabled(int)</signal> -</signals> -<slots> - <slot>slotSelectionChanged(QListBoxItem*)</slot> -</slots> -<layoutdefaults spacing="6" margin="11"/> +</Q_SIGNALS> +<Q_SLOTS> + <slot>slotSelectionChanged(TQListBoxItem*)</slot> +</Q_SLOTS> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kurlrequester.h</includehint> <includehint>klineedit.h</includehint> |