From 48d4a26399959121f33d2bc3bfe51c7827b654fc Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 14 Jun 2011 16:45:05 +0000 Subject: 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 --- languages/python/README.dox | 2 +- .../python/app_templates/pyqt/documentdetails.ui | 14 +++++++------- .../python/app_templates/pyqt/templates-ui-dialog | 4 ++-- .../python/app_templates/pyqt/templates-ui-mainwin | 8 ++++---- languages/python/doc/python.toc | 20 ++++++++++---------- languages/python/kde_pydoc.py | 8 ++++---- languages/python/pythonconfigwidget.cpp | 4 ++-- languages/python/pythonconfigwidget.h | 3 ++- languages/python/pythonconfigwidgetbase.ui | 18 +++++++++--------- languages/python/pythonimplementationwidget.cpp | 12 ++++++------ languages/python/pythonimplementationwidget.h | 3 ++- languages/python/pythonsupportpart.cpp | 22 +++++++++++----------- languages/python/pythonsupportpart.h | 3 ++- languages/python/qtdesignerpythonintegration.cpp | 12 ++++++------ languages/python/qtdesignerpythonintegration.h | 11 ++++++----- 15 files changed, 74 insertions(+), 70 deletions(-) (limited to 'languages/python') diff --git a/languages/python/README.dox b/languages/python/README.dox index 77d0f44c..e581f9e1 100644 --- a/languages/python/README.dox +++ b/languages/python/README.dox @@ -14,7 +14,7 @@ and images. \maintainer nth maintainer full name \feature Python support -\feature Consult \ref LangSupportStatus for a up to date features/status of this programming language support part. +\feature Consult \ref LangSupporttqStatus for a up to date features/status of this programming language support part. \bug Describe a the 1st bug that you know of, but probably hasn't been reported yet. .. diff --git a/languages/python/app_templates/pyqt/documentdetails.ui b/languages/python/app_templates/pyqt/documentdetails.ui index 130d30ef..f1298465 100644 --- a/languages/python/app_templates/pyqt/documentdetails.ui +++ b/languages/python/app_templates/pyqt/documentdetails.ui @@ -1,6 +1,6 @@ documentDetails - + documentDetails @@ -19,7 +19,7 @@ unnamed - + textLabel1 @@ -38,7 +38,7 @@ PlainText - + groupBox1 @@ -49,7 +49,7 @@ unnamed - + textLabel2 @@ -57,14 +57,14 @@ Name: - + lineEdit1 - + groupBox2 @@ -76,5 +76,5 @@ - + diff --git a/languages/python/app_templates/pyqt/templates-ui-dialog b/languages/python/app_templates/pyqt/templates-ui-dialog index fc2aefce..4b0c8bb2 100644 --- a/languages/python/app_templates/pyqt/templates-ui-dialog +++ b/languages/python/app_templates/pyqt/templates-ui-dialog @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -16,5 +16,5 @@ Form1 - + diff --git a/languages/python/app_templates/pyqt/templates-ui-mainwin b/languages/python/app_templates/pyqt/templates-ui-mainwin index 854da009..4e0a093b 100644 --- a/languages/python/app_templates/pyqt/templates-ui-mainwin +++ b/languages/python/app_templates/pyqt/templates-ui-mainwin @@ -1,6 +1,6 @@ Form1 - + Form1 @@ -415,7 +415,7 @@ helpAbout() - + fileNew() fileOpen() fileSave() @@ -431,6 +431,6 @@ helpIndex() helpContents() helpAbout() - - + + diff --git a/languages/python/doc/python.toc b/languages/python/doc/python.toc index e5c67dda..a4604a97 100644 --- a/languages/python/doc/python.toc +++ b/languages/python/doc/python.toc @@ -162,7 +162,7 @@ - + @@ -293,7 +293,7 @@ - + @@ -410,7 +410,7 @@ - + @@ -1031,7 +1031,7 @@ - + @@ -1077,7 +1077,7 @@ - + @@ -1362,7 +1362,7 @@ - + @@ -1394,7 +1394,7 @@ - + @@ -1527,7 +1527,7 @@ - + @@ -1544,8 +1544,8 @@ - - + + diff --git a/languages/python/kde_pydoc.py b/languages/python/kde_pydoc.py index 0516f172..eb7c6b44 100755 --- a/languages/python/kde_pydoc.py +++ b/languages/python/kde_pydoc.py @@ -7,7 +7,7 @@ __version__ = "6 April 2006" import sys, imp, os, stat, re, types, cgi from repr import Repr -from string import expandtabs, find, join, lower, split, strip, rstrip +from string import expandtabs, tqfind, join, lower, split, strip, rstrip import pydoc @@ -16,19 +16,19 @@ import pydoc def cleanlinks(string): """Changes the links to work with the pydoc:-notation""" finalstring = "" - string = str(string).replace(".html","") + string = str(string).tqreplace(".html","") pos = 0 mark = "setText(DomUtil::readEntry(dom, "/kdevpythonsupport/run/interpreter")); terminal_box->setChecked(DomUtil::readBoolEntry(dom, "/kdevpythonsupport/run/terminal")); diff --git a/languages/python/pythonconfigwidget.h b/languages/python/pythonconfigwidget.h index 674b8e3c..16ed799d 100644 --- a/languages/python/pythonconfigwidget.h +++ b/languages/python/pythonconfigwidget.h @@ -19,9 +19,10 @@ class PythonConfigWidget : public PythonConfigWidgetBase { Q_OBJECT + TQ_OBJECT public: - PythonConfigWidget( TQDomDocument &projectDom, TQWidget *parent=0, const char *name=0 ); + PythonConfigWidget( TQDomDocument &projectDom, TQWidget *tqparent=0, const char *name=0 ); ~PythonConfigWidget(); public slots: diff --git a/languages/python/pythonconfigwidgetbase.ui b/languages/python/pythonconfigwidgetbase.ui index d3228822..0aa9a5bd 100644 --- a/languages/python/pythonconfigwidgetbase.ui +++ b/languages/python/pythonconfigwidgetbase.ui @@ -1,6 +1,6 @@ PythonConfigWidgetBase - + python_config_widget @@ -19,7 +19,7 @@ unnamed - + interpreter_label @@ -30,7 +30,7 @@ interpreter_edit - + Layout1 @@ -57,7 +57,7 @@ Expanding - + 20 20 @@ -76,14 +76,14 @@ Minimum - + 20 20 - + terminal_box @@ -101,7 +101,7 @@ Expanding - + 20 20 @@ -113,8 +113,8 @@ kdialog.h - - + + klineedit.h diff --git a/languages/python/pythonimplementationwidget.cpp b/languages/python/pythonimplementationwidget.cpp index 9aba5441..9e979f13 100644 --- a/languages/python/pythonimplementationwidget.cpp +++ b/languages/python/pythonimplementationwidget.cpp @@ -34,8 +34,8 @@ #include PythonImplementationWidget::PythonImplementationWidget(KDevLanguageSupport* part, - TQWidget* parent, const char* name, bool modal) - : ImplementationWidget(part, parent, name, modal) + TQWidget* tqparent, const char* name, bool modal) + : ImplementationWidget(part, tqparent, name, modal) { } @@ -48,12 +48,12 @@ PythonImplementationWidget::~PythonImplementationWidget() TQStringList PythonImplementationWidget::createClassFiles() { // TQString template_py = "require '$BASEFILENAME$'\n\nclass $CLASSNAME$ < $BASECLASSNAME$\n\n def initialize(*k)\n super(*k)\n end\n\nend\n"; - TQString template_py = "from qt import *\nfrom $BASEFILENAME$ import *\nclass $CLASSNAME$($BASECLASSNAME$):\n\n def __init__(self,parent,name):\n $BASECLASSNAME$.__init__(self,parent,name)\n \n\n\n"; + TQString template_py = "from qt import *\nfrom $BASEFILENAME$ import *\nclass $CLASSNAME$($BASECLASSNAME$):\n\n def __init__(self,tqparent,name):\n $BASECLASSNAME$.__init__(self,tqparent,name)\n \n\n\n"; TQFileInfo formInfo(m_formName); - template_py.replace(TQRegExp("\\$BASEFILENAME\\$"), formInfo.baseName()+".py"); - template_py.replace(TQRegExp("\\$CLASSNAME\\$"), classNameEdit->text()); - template_py.replace(TQRegExp("\\$BASECLASSNAME\\$"), m_baseClassName); + template_py.tqreplace(TQRegExp("\\$BASEFILENAME\\$"), formInfo.baseName()+".py"); + template_py.tqreplace(TQRegExp("\\$CLASSNAME\\$"), classNameEdit->text()); + template_py.tqreplace(TQRegExp("\\$BASECLASSNAME\\$"), m_baseClassName); template_py = FileTemplate::read(m_part, "py") + template_py; diff --git a/languages/python/pythonimplementationwidget.h b/languages/python/pythonimplementationwidget.h index e8838bab..c2ca5cc3 100644 --- a/languages/python/pythonimplementationwidget.h +++ b/languages/python/pythonimplementationwidget.h @@ -25,8 +25,9 @@ class PythonImplementationWidget : public ImplementationWidget { Q_OBJECT + TQ_OBJECT public: - PythonImplementationWidget(KDevLanguageSupport* part, TQWidget* parent = 0, const char* name = 0, bool modal = true); + PythonImplementationWidget(KDevLanguageSupport* part, TQWidget* tqparent = 0, const char* name = 0, bool modal = true); ~PythonImplementationWidget(); diff --git a/languages/python/pythonsupportpart.cpp b/languages/python/pythonsupportpart.cpp index dc7df754..d1f2e503 100644 --- a/languages/python/pythonsupportpart.cpp +++ b/languages/python/pythonsupportpart.cpp @@ -42,8 +42,8 @@ typedef KDevGenericFactory PythonSupportFactory; static const KDevPluginInfo data("kdevpythonsupport"); K_EXPORT_COMPONENT_FACTORY( libkdevpythonsupport, PythonSupportFactory( data ) ) -PythonSupportPart::PythonSupportPart(TQObject *parent, const char *name, const TQStringList &) - : KDevLanguageSupport(&data, parent, name ? name : "PythonSupportPart") +PythonSupportPart::PythonSupportPart(TQObject *tqparent, const char *name, const TQStringList &) + : KDevLanguageSupport(&data, tqparent, name ? name : "PythonSupportPart") { setInstance(PythonSupportFactory::instance()); @@ -100,7 +100,7 @@ void PythonSupportPart::contextMenu(TQPopupMenu *popup, const Context *context) { m_contextFileName = url.fileName(); int id = popup->insertItem(i18n("Create or Select Implementation..."), this, TQT_SLOT(slotCreateSubclass())); - popup->setWhatsThis(id, i18n("Create or select implementation

Creates or selects a subclass of selected form for use with integrated KDevDesigner.")); + popup->tqsetWhatsThis(id, i18n("Create or select implementation

Creates or selects a subclass of selected form for use with integrated KDevDesigner.")); } } } @@ -210,7 +210,7 @@ void PythonSupportPart::savedFile(const KURL &fileName) { kdDebug(9014) << "savedFile()" << endl; - if (project()->allFiles().contains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) { + if (project()->allFiles().tqcontains(fileName.path().mid ( project()->projectDirectory().length() + 1 ))) { maybeParse(fileName.path()); emit addedSourceInfo( fileName.path() ); } @@ -264,11 +264,11 @@ void PythonSupportPart::parse(const TQString &fileName) lastClass->setFileName( fileName ); lastClass->setStartPosition( lineNo, 0 ); - TQStringList parentList = TQStringList::split(",", classre.cap(3)); + TQStringList tqparentList = TQStringList::split(",", classre.cap(3)); TQStringList::ConstIterator it; - for (it = parentList.begin(); it != parentList.end(); ++it) { + for (it = tqparentList.begin(); it != tqparentList.end(); ++it) { TQString baseName = (*it).stripWhiteSpace(); - kdDebug(9014) << "Add parent" << baseName << endl; + kdDebug(9014) << "Add tqparent" << baseName << endl; lastClass->addBaseClass( baseName ); } @@ -349,7 +349,7 @@ void PythonSupportPart::slotStartInterpreter() void PythonSupportPart::slotExecuteString() { bool ok; - TQString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), TQString::null, &ok, 0); + TQString cmd = KInputDialog::getText(i18n("String to Execute"), i18n("String to execute:"), TQString(), &ok, 0); if (ok) { cmd.prepend("'"); cmd.append("'"); @@ -374,12 +374,12 @@ KDevDesignerIntegration *PythonSupportPart::designer(KInterfaceDesigner::Designe KDevDesignerIntegration *des = 0; switch (type) { - case KInterfaceDesigner::QtDesigner: + case KInterfaceDesigner::TQtDesigner: des = m_designers[type]; if (des == 0) { PythonImplementationWidget *impl = new PythonImplementationWidget(this); - des = new QtDesignerPythonIntegration(this, impl); + des = new TQtDesignerPythonIntegration(this, impl); des->loadSettings(*project()->projectDom(), "kdevpythonsupport/designerintegration"); m_designers[type] = des; @@ -398,7 +398,7 @@ void PythonSupportPart::slotCreateSubclass() kdDebug(9014) << k_funcinfo << " file: " << m_contextFileName << " ext: " << fi.extension(false) << endl; if (fi.extension(false) != "ui") return; - QtDesignerPythonIntegration *des = dynamic_cast(designer(KInterfaceDesigner::QtDesigner)); + TQtDesignerPythonIntegration *des = dynamic_cast(designer(KInterfaceDesigner::TQtDesigner)); if (des) { kdDebug(9014) << "ok: " << des << endl; diff --git a/languages/python/pythonsupportpart.h b/languages/python/pythonsupportpart.h index 0ea9f1b5..01fde048 100644 --- a/languages/python/pythonsupportpart.h +++ b/languages/python/pythonsupportpart.h @@ -23,9 +23,10 @@ class Context; class PythonSupportPart : public KDevLanguageSupport { Q_OBJECT + TQ_OBJECT public: - PythonSupportPart( TQObject *parent, const char *name, const TQStringList & ); + PythonSupportPart( TQObject *tqparent, const char *name, const TQStringList & ); ~PythonSupportPart(); virtual KDevDesignerIntegration *designer(KInterfaceDesigner::DesignerType type); diff --git a/languages/python/qtdesignerpythonintegration.cpp b/languages/python/qtdesignerpythonintegration.cpp index 53950f65..c0e6dba1 100644 --- a/languages/python/qtdesignerpythonintegration.cpp +++ b/languages/python/qtdesignerpythonintegration.cpp @@ -38,18 +38,18 @@ #include "codemodel_utils.h" #include "implementationwidget.h" -QtDesignerPythonIntegration::QtDesignerPythonIntegration(KDevLanguageSupport* part, ImplementationWidget* impl) - :QtDesignerIntegration(part, impl, false, 0) +TQtDesignerPythonIntegration::TQtDesignerPythonIntegration(KDevLanguageSupport* part, ImplementationWidget* impl) + :TQtDesignerIntegration(part, impl, false, 0) { } -QtDesignerPythonIntegration::~QtDesignerPythonIntegration() +TQtDesignerPythonIntegration::~TQtDesignerPythonIntegration() { } -void QtDesignerPythonIntegration::addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass) +void TQtDesignerPythonIntegration::addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass) { m_part->partController()->editDocument( KURL( klass->fileName() ) ); KTextEditor::EditInterface* editIface = dynamic_cast( m_part->partController()->activePart() ); @@ -65,7 +65,7 @@ void QtDesignerPythonIntegration::addFunctionToClass(KInterfaceDesigner::Functio klass->getStartPosition( &line, &column ); // compute the insertion point - QPair point; + TQPair point; point.first = line + 1; point.second = column; @@ -78,7 +78,7 @@ void QtDesignerPythonIntegration::addFunctionToClass(KInterfaceDesigner::Functio } TQString func = function.function; - func.replace("()", ""); + func.tqreplace("()", ""); TQString str = " def " + func + "(self):\n\n"; kdDebug(9014) << "insert " << str << " into " << point.first << endl; diff --git a/languages/python/qtdesignerpythonintegration.h b/languages/python/qtdesignerpythonintegration.h index e4b3bcae..8af2f271 100644 --- a/languages/python/qtdesignerpythonintegration.h +++ b/languages/python/qtdesignerpythonintegration.h @@ -17,18 +17,19 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QTDESIGNERPYTHONINTEGRATION_H -#define QTDESIGNERPYTHONINTEGRATION_H +#ifndef TQTDESIGNERPYTHONINTEGRATION_H +#define TQTDESIGNERPYTHONINTEGRATION_H #include -class QtDesignerPythonIntegration : public QtDesignerIntegration +class TQtDesignerPythonIntegration : public TQtDesignerIntegration { Q_OBJECT + TQ_OBJECT public: - QtDesignerPythonIntegration(KDevLanguageSupport* part, ImplementationWidget* impl); + TQtDesignerPythonIntegration(KDevLanguageSupport* part, ImplementationWidget* impl); - ~QtDesignerPythonIntegration(); + ~TQtDesignerPythonIntegration(); virtual void addFunctionToClass(KInterfaceDesigner::Function function, ClassDom klass); -- cgit v1.2.3