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 --- .../designer_integration/implementationwidget.cpp | 32 ++++++++--------- .../designer_integration/implementationwidget.h | 7 ++-- .../implementationwidgetbase.ui | 36 +++++++++---------- .../designer_integration/qtdesignerintegration.cpp | 42 +++++++++++----------- .../designer_integration/qtdesignerintegration.h | 15 ++++---- 5 files changed, 67 insertions(+), 65 deletions(-) (limited to 'languages/lib/designer_integration') diff --git a/languages/lib/designer_integration/implementationwidget.cpp b/languages/lib/designer_integration/implementationwidget.cpp index c961657b..6198f9bc 100644 --- a/languages/lib/designer_integration/implementationwidget.cpp +++ b/languages/lib/designer_integration/implementationwidget.cpp @@ -40,10 +40,10 @@ namespace ImplUtils{ class ClassItem: public KListViewItem{ public: - ClassItem(KListViewItem *parent, ClassDom dom) - :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } - ClassItem(KListView *parent, ClassDom dom) - :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } + ClassItem(KListViewItem *tqparent, ClassDom dom) + :KListViewItem(tqparent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } + ClassItem(KListView *tqparent, ClassDom dom) + :KListViewItem(tqparent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } ClassDom dom() const { return m_dom; } private: ClassDom m_dom; @@ -51,18 +51,18 @@ private: class NamespaceItem: public KListViewItem{ public: - NamespaceItem(KListViewItem *parent, NamespaceDom dom) - :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } - NamespaceItem(KListView *parent, NamespaceDom dom) - :KListViewItem(parent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } + NamespaceItem(KListViewItem *tqparent, NamespaceDom dom) + :KListViewItem(tqparent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } + NamespaceItem(KListView *tqparent, NamespaceDom dom) + :KListViewItem(tqparent, dom->name(), dom->fileName()), m_dom(dom) { setOpen(true); } NamespaceDom dom() const { return m_dom; } private: NamespaceDom m_dom; }; } -ImplementationWidget::ImplementationWidget(KDevLanguageSupport *part, TQWidget* parent, const char* name, bool modal) - :CreateImplemenationWidgetBase(parent, name, modal), m_part(part) +ImplementationWidget::ImplementationWidget(KDevLanguageSupport *part, TQWidget* tqparent, const char* name, bool modal) + :CreateImplemenationWidgetBase(tqparent, name, modal), m_part(part) { } @@ -77,28 +77,28 @@ void ImplementationWidget::init(const TQString &formName) TQDomDocument doc; DomUtil::openDOMFile(doc, m_formName); m_baseClassName = DomUtil::elementByPathExt(doc, "class").text(); - setCaption(i18n("Create or Select Implementation Class for: %1").arg(m_baseClassName)); + setCaption(i18n("Create or Select Implementation Class for: %1").tqarg(m_baseClassName)); KListViewItem *item = new KListViewItem(classView, i18n("Namespaces && Classes")); item->setOpen(true); processNamespaces(m_part->codeModel()->globalNamespace(), item); } -void ImplementationWidget::processNamespaces(NamespaceDom dom, KListViewItem *parent) +void ImplementationWidget::processNamespaces(NamespaceDom dom, KListViewItem *tqparent) { const NamespaceList nslist = dom->namespaceList(); for (NamespaceList::const_iterator it = nslist.begin(); it != nslist.end(); ++it) - processNamespaces(*it, new ImplUtils::NamespaceItem(parent, *it)); + processNamespaces(*it, new ImplUtils::NamespaceItem(tqparent, *it)); const ClassList cllist = dom->classList(); for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it) - processClasses(*it, new ImplUtils::ClassItem(parent, *it)); + processClasses(*it, new ImplUtils::ClassItem(tqparent, *it)); } -void ImplementationWidget::processClasses(ClassDom dom, KListViewItem *parent) +void ImplementationWidget::processClasses(ClassDom dom, KListViewItem *tqparent) { const ClassList cllist = dom->classList(); for (ClassList::ConstIterator it = cllist.begin(); it != cllist.end(); ++it) - processClasses(*it, new ImplUtils::ClassItem(parent, *it)); + processClasses(*it, new ImplUtils::ClassItem(tqparent, *it)); } ImplementationWidget::~ImplementationWidget() diff --git a/languages/lib/designer_integration/implementationwidget.h b/languages/lib/designer_integration/implementationwidget.h index b639b0e8..91f93228 100644 --- a/languages/lib/designer_integration/implementationwidget.h +++ b/languages/lib/designer_integration/implementationwidget.h @@ -40,8 +40,9 @@ Subclasses of this class should reimplement only pure virtual functions in the c class ImplementationWidget : public CreateImplemenationWidgetBase { Q_OBJECT + TQ_OBJECT public: - ImplementationWidget(KDevLanguageSupport *part, TQWidget* parent = 0, const char* name = 0, bool modal = false); + ImplementationWidget(KDevLanguageSupport *part, TQWidget* tqparent = 0, const char* name = 0, bool modal = false); virtual ~ImplementationWidget(); /*$PUBLIC_FUNCTIONS$*/ @@ -60,8 +61,8 @@ protected: the number of classes being displayed as possible implementation classes.*/ void init(const TQString &formName); - void processNamespaces(NamespaceDom dom, KListViewItem *parent); - void processClasses(ClassDom dom, KListViewItem *parent); + void processNamespaces(NamespaceDom dom, KListViewItem *tqparent); + void processClasses(ClassDom dom, KListViewItem *tqparent); /**Creates a class and adds it to a project. No need to reimplement.*/ bool createClass(); diff --git a/languages/lib/designer_integration/implementationwidgetbase.ui b/languages/lib/designer_integration/implementationwidgetbase.ui index 1a39d39e..fece6815 100644 --- a/languages/lib/designer_integration/implementationwidgetbase.ui +++ b/languages/lib/designer_integration/implementationwidgetbase.ui @@ -1,6 +1,6 @@ CreateImplemenationWidgetBase - + CreateImplemenationWidgetBase @@ -19,9 +19,9 @@ unnamed - + - layout4 + tqlayout4 @@ -37,14 +37,14 @@ Expanding - + 40 20 - + okButton @@ -63,7 +63,7 @@ true - + cancelButton @@ -81,7 +81,7 @@ - + buttonGroup1 @@ -92,7 +92,7 @@ unnamed - + createButton @@ -133,15 +133,15 @@ false - + - layout2 + tqlayout2 unnamed - + classNameLabel @@ -159,7 +159,7 @@ - + useButton @@ -167,15 +167,15 @@ Use &existing class - + - layout2_2 + tqlayout2_2 unnamed - + fileNameLabel @@ -257,10 +257,10 @@ okButton cancelButton - + classNameChanged(const QString &) - - + + klistview.h diff --git a/languages/lib/designer_integration/qtdesignerintegration.cpp b/languages/lib/designer_integration/qtdesignerintegration.cpp index f66b1b61..f46bd422 100644 --- a/languages/lib/designer_integration/qtdesignerintegration.cpp +++ b/languages/lib/designer_integration/qtdesignerintegration.cpp @@ -38,48 +38,48 @@ #include "codemodel_utils.h" #include "implementationwidget.h" -QtDesignerIntegration::QtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl, bool classHasDefinitions, const char* name) +TQtDesignerIntegration::TQtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl, bool classHasDefinitions, const char* name) :KDevDesignerIntegration(part, name), m_part(part), m_impl(impl), m_classHasDefinitions(classHasDefinitions) { } -QtDesignerIntegration::~QtDesignerIntegration() +TQtDesignerIntegration::~TQtDesignerIntegration() { delete m_impl; } -void QtDesignerIntegration::addFunction(const TQString& formName, KInterfaceDesigner::Function function) +void TQtDesignerIntegration::addFunction(const TQString& formName, KInterfaceDesigner::Function function) { - kdDebug() << "QtDesignerIntegration::addFunction: form: " << formName << ", function: " << function.function << endl; + kdDebug() << "TQtDesignerIntegration::addFunction: form: " << formName << ", function: " << function.function << endl; - if (!m_implementations.contains(formName)) + if (!m_implementations.tqcontains(formName)) if (!selectImplementation(formName)) return; ClassDom klass = m_implementations[formName]; if (!klass) { - KMessageBox::error(0, i18n("Cannot find implementation class for form: %1").arg(formName)); + KMessageBox::error(0, i18n("Cannot find implementation class for form: %1").tqarg(formName)); return; } addFunctionToClass(function, klass); } -void QtDesignerIntegration::editFunction(const TQString& formName, KInterfaceDesigner::Function oldFunction, KInterfaceDesigner::Function function) +void TQtDesignerIntegration::editFunction(const TQString& formName, KInterfaceDesigner::Function oldFunction, KInterfaceDesigner::Function function) { - kdDebug() << "QtDesignerIntegration::editFunction: form: " << formName + kdDebug() << "TQtDesignerIntegration::editFunction: form: " << formName << ", old function: " << oldFunction.function << ", function: " << function.function << endl; } -void QtDesignerIntegration::removeFunction(const TQString& formName, KInterfaceDesigner::Function function) +void TQtDesignerIntegration::removeFunction(const TQString& formName, KInterfaceDesigner::Function function) { - kdDebug() << "QtDesignerIntegration::removeFunction: form: " << formName << ", function: " << function.function << endl; + kdDebug() << "TQtDesignerIntegration::removeFunction: form: " << formName << ", function: " << function.function << endl; } -bool QtDesignerIntegration::selectImplementation(const TQString &formName) +bool TQtDesignerIntegration::selectImplementation(const TQString &formName) { TQFileInfo fi(formName); if (!fi.exists()) @@ -93,7 +93,7 @@ bool QtDesignerIntegration::selectImplementation(const TQString &formName) return false; } -void QtDesignerIntegration::loadSettings(TQDomDocument dom, TQString path) +void TQtDesignerIntegration::loadSettings(TQDomDocument dom, TQString path) { TQDomElement el = DomUtil::elementByPath(dom, path + "/qtdesigner"); if (el.isNull()) @@ -117,9 +117,9 @@ void QtDesignerIntegration::loadSettings(TQDomDocument dom, TQString path) } } -void QtDesignerIntegration::saveSettings(TQDomDocument dom, TQString path) +void TQtDesignerIntegration::saveSettings(TQDomDocument dom, TQString path) { - kdDebug() << "QtDesignerIntegration::saveSettings" << endl; + kdDebug() << "TQtDesignerIntegration::saveSettings" << endl; TQDomElement el = DomUtil::createElementByPath(dom, path + "/qtdesigner"); for (TQMap::const_iterator it = m_implementations.begin(); it != m_implementations.end(); ++it) @@ -134,13 +134,13 @@ void QtDesignerIntegration::saveSettings(TQDomDocument dom, TQString path) } } -void QtDesignerIntegration::openFunction(const TQString &formName, const TQString &functionName) +void TQtDesignerIntegration::openFunction(const TQString &formName, const TQString &functionName) { - kdDebug() << "QtDesignerIntegration::openFunction, formName = " << formName + kdDebug() << "TQtDesignerIntegration::openFunction, formName = " << formName << ", functionName = " << functionName << endl; TQString fn = functionName; - if (fn.find("(") > 0) - fn.remove(fn.find("("), fn.length()); + if (fn.tqfind("(") > 0) + fn.remove(fn.tqfind("("), fn.length()); if (!m_implementations[formName]) return; @@ -177,14 +177,14 @@ void QtDesignerIntegration::openFunction(const TQString &formName, const TQStrin m_part->partController()->editDocument(KURL(impl), line, col); } -void QtDesignerIntegration::processImplementationName(TQString &// name +void TQtDesignerIntegration::processImplementationName(TQString &// name ) { } -void QtDesignerIntegration::openSource(const TQString &formName) +void TQtDesignerIntegration::openSource(const TQString &formName) { - if (!m_implementations.contains(formName)) + if (!m_implementations.tqcontains(formName)) if (!selectImplementation(formName)) return; TQString impl = m_implementations[formName]->fileName(); diff --git a/languages/lib/designer_integration/qtdesignerintegration.h b/languages/lib/designer_integration/qtdesignerintegration.h index a31310eb..9a750fbd 100644 --- a/languages/lib/designer_integration/qtdesignerintegration.h +++ b/languages/lib/designer_integration/qtdesignerintegration.h @@ -17,8 +17,8 @@ * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ -#ifndef QTDESIGNERINTEGRATION_H -#define QTDESIGNERINTEGRATION_H +#ifndef TQTDESIGNERINTEGRATION_H +#define TQTDESIGNERINTEGRATION_H #include @@ -29,19 +29,20 @@ class KDevLanguageSupport; class ImplementationWidget; /** -Qt Designer integration base class. +TQt Designer integration base class. Contains language-independent implementation part of a @ref KDevDesignerIntegration interface. Ready to use in KDevelop language support plugins. Subclasses of this class should reimplement only pure virtual functions in the common case. */ -class QtDesignerIntegration : public KDevDesignerIntegration +class TQtDesignerIntegration : public KDevDesignerIntegration { Q_OBJECT + TQ_OBJECT public: - QtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl, + TQtDesignerIntegration(KDevLanguageSupport *part, ImplementationWidget *impl, bool classHasDefinitions, const char* name = 0); - virtual ~QtDesignerIntegration(); + virtual ~TQtDesignerIntegration(); public slots: virtual void addFunction(const TQString& formName, KInterfaceDesigner::Function function); @@ -65,7 +66,7 @@ protected: separate files for interface and implementation parts of a class. For example, C++ language support plugin will do: @code - name.replace(".h", ".cpp"); + name.tqreplace(".h", ".cpp"); @endcode*/ virtual void processImplementationName(TQString &name); -- cgit v1.2.1