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 --- parts/classview/classtreebase.cpp | 174 +++++++++++++++++++------------------- 1 file changed, 87 insertions(+), 87 deletions(-) (limited to 'parts/classview/classtreebase.cpp') diff --git a/parts/classview/classtreebase.cpp b/parts/classview/classtreebase.cpp index f5c0f4b9..c6d2770e 100644 --- a/parts/classview/classtreebase.cpp +++ b/parts/classview/classtreebase.cpp @@ -13,9 +13,9 @@ #include "classtreebase.h" -#include -#include -#include +#include +#include +#include #include #include #include @@ -40,11 +40,11 @@ KPopupMenu *ClassTreeItem::createPopup() KPopupMenu *popup = new KPopupMenu(); if (features & KDevLanguageSupport::Declarations) - popup->insertItem( i18n("Go to Declaration"), classTree(), SLOT(slotGotoDeclaration()) ); + popup->insertItem( i18n("Go to Declaration"), classTree(), TQT_SLOT(slotGotoDeclaration()) ); if (m_item->itemType() == PIT_METHOD) - popup->insertItem( i18n("Go to Definition"), classTree(), SLOT(slotGotoImplementation()) ); + popup->insertItem( i18n("Go to Definition"), classTree(), TQT_SLOT(slotGotoImplementation()) ); - QString title; + TQString title; switch(m_item->itemType()) { case PIT_CLASS: { @@ -52,13 +52,13 @@ KPopupMenu *ClassTreeItem::createPopup() bool hasAddMethod = features & KDevLanguageSupport::AddMethod; bool hasAddAttribute = features & KDevLanguageSupport::AddAttribute; if (hasAddMethod) - popup->insertItem( i18n("Add Method..."), classTree(), SLOT(slotAddMethod())); + popup->insertItem( i18n("Add Method..."), classTree(), TQT_SLOT(slotAddMethod())); if (hasAddAttribute) - popup->insertItem( i18n("Add Attribute..."), classTree(), SLOT(slotAddAttribute())); + popup->insertItem( i18n("Add Attribute..."), classTree(), TQT_SLOT(slotAddAttribute())); popup->insertSeparator(); - popup->insertItem( i18n("Parent Classes..."), classTree(), SLOT(slotClassBaseClasses())); - popup->insertItem( i18n("Child Classes..."), classTree(), SLOT(slotClassDerivedClasses())); - popup->insertItem( i18n("Class Tool..."), classTree(), SLOT(slotClassTool())); + popup->insertItem( i18n("Parent Classes..."), classTree(), TQT_SLOT(slotClassBaseClasses())); + popup->insertItem( i18n("Child Classes..."), classTree(), TQT_SLOT(slotClassDerivedClasses())); + popup->insertItem( i18n("Class Tool..."), classTree(), TQT_SLOT(slotClassTool())); } break; case PIT_STRUCT: @@ -90,16 +90,16 @@ KPopupMenu *ClassTreeItem::createPopup() } -QString ClassTreeItem::scopedText() const +TQString ClassTreeItem::scopedText() const { if (m_item) return m_item->path(); - return QString::null; + return TQString::null; } -void ClassTreeItem::getDeclaration(QString *toFile, int *toLine) +void ClassTreeItem::getDeclaration(TQString *toFile, int *toLine) { if (m_item) { *toFile = m_item->declaredInFile(); @@ -108,7 +108,7 @@ void ClassTreeItem::getDeclaration(QString *toFile, int *toLine) } -void ClassTreeItem::getImplementation(QString *toFile, int *toLine) +void ClassTreeItem::getImplementation(TQString *toFile, int *toLine) { if (m_item) { *toFile = m_item->definedInFile(); @@ -117,15 +117,15 @@ void ClassTreeItem::getImplementation(QString *toFile, int *toLine) } -QString ClassTreeItem::text( int ) const +TQString ClassTreeItem::text( int ) const { if (m_item) return m_item->asString(); - return QString::null; + return TQString::null; } -QString ClassTreeItem::tipText() const +TQString ClassTreeItem::tipText() const { // Purposefully avoid virtual dispatch here return ClassTreeItem::text(0); @@ -146,10 +146,10 @@ void ClassTreeScopeItem::init() } -QString ClassTreeScopeItem::text( int col ) const +TQString ClassTreeScopeItem::text( int col ) const { if (!m_item) - return QString::null; + return TQString::null; if (m_item->name().isEmpty()) return i18n("Global"); return ClassTreeItem::text( col ); @@ -171,39 +171,39 @@ void ClassTreeScopeItem::setOpen(bool o) KDevLanguageSupport::Features features = classTree()->m_part->languageSupport()->features(); // Add namespaces - QValueList scopeList = pScope->getSortedScopeList(); - QValueList::ConstIterator it; + TQValueList scopeList = pScope->getSortedScopeList(); + TQValueList::ConstIterator it; for (it = scopeList.begin(); it != scopeList.end(); ++it) lastItem = new ClassTreeScopeItem(this, lastItem, *it); if (features & KDevLanguageSupport::Classes) { // Add classes - QValueList classList = pScope->getSortedClassList(); - QValueList::ConstIterator it; + TQValueList classList = pScope->getSortedClassList(); + TQValueList::ConstIterator it; for (it = classList.begin(); it != classList.end(); ++it) lastItem = new ClassTreeClassItem(this, lastItem, *it); } if (features & KDevLanguageSupport::Structs) { // Add structs - QValueList structList = pScope->getSortedStructList(); - QValueList::ConstIterator it; + TQValueList structList = pScope->getSortedStructList(); + TQValueList::ConstIterator it; for (it = structList.begin(); it != structList.end(); ++it) lastItem = new ClassTreeClassItem(this, lastItem, *it, true); } if (features & KDevLanguageSupport::Functions) { // Add functions - QValueList methodList = pScope->getSortedMethodList(); - QValueList::ConstIterator it; + TQValueList methodList = pScope->getSortedMethodList(); + TQValueList::ConstIterator it; for (it = methodList.begin(); it != methodList.end(); ++it) lastItem = new ClassTreeMethodItem(this, lastItem, *it); } if (features & KDevLanguageSupport::Variables) { // Add attributes - QValueList attrList = pScope->getSortedAttributeList(); - QValueList::ConstIterator it; + TQValueList attrList = pScope->getSortedAttributeList(); + TQValueList::ConstIterator it; for (it = attrList.begin(); it != attrList.end(); ++it) lastItem = new ClassTreeAttrItem(this, lastItem, *it); } @@ -232,38 +232,38 @@ void ClassTreeClassItem::setOpen(bool o) ClassTreeItem *lastItem = 0; // Add nested classes - QValueList classList = pClass->getSortedClassList(); - QValueList::ConstIterator classIt; + TQValueList classList = pClass->getSortedClassList(); + TQValueList::ConstIterator classIt; for (classIt = classList.begin(); classIt != classList.end(); ++classIt) lastItem = new ClassTreeClassItem(this, lastItem, *classIt); // Add nested structs - QValueList structList = pClass->getSortedStructList(); - QValueList::ConstIterator structIt; + TQValueList structList = pClass->getSortedStructList(); + TQValueList::ConstIterator structIt; for (structIt = structList.begin(); structIt != structList.end(); ++structIt) lastItem = new ClassTreeClassItem(this, lastItem, *structIt, true); // Add methods - QValueList methodList = pClass->getSortedMethodList(); - QValueList::ConstIterator methodIt; + TQValueList methodList = pClass->getSortedMethodList(); + TQValueList::ConstIterator methodIt; for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) lastItem = new ClassTreeMethodItem(this, lastItem, *methodIt); // Add slots - QValueList slotList = pClass->getSortedSlotList(); - QValueList::ConstIterator slotIt; + TQValueList slotList = pClass->getSortedSlotList(); + TQValueList::ConstIterator slotIt; for (slotIt = slotList.begin(); slotIt != slotList.end(); ++slotIt) lastItem = new ClassTreeMethodItem(this, lastItem, *slotIt); // Add signals - QValueList signalList = pClass->getSortedSignalList(); - QValueList::ConstIterator signalIt; + TQValueList signalList = pClass->getSortedSignalList(); + TQValueList::ConstIterator signalIt; for (signalIt = signalList.begin(); signalIt != signalList.end(); ++signalIt) lastItem = new ClassTreeMethodItem(this, lastItem, *signalIt); // Add attributes - QValueList attrList = pClass->getSortedAttributeList(); - QValueList::ConstIterator attrIt; + TQValueList attrList = pClass->getSortedAttributeList(); + TQValueList::ConstIterator attrIt; for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) lastItem = new ClassTreeAttrItem(this, lastItem, *attrIt); @@ -276,7 +276,7 @@ ClassTreeMethodItem::ClassTreeMethodItem(ClassTreeItem *parent, ClassTreeItem *l ParsedMethod *parsedMethod) : ClassTreeItem(parent, lastSibling, parsedMethod) { - QString icon; + TQString icon; if ( !parsedMethod ) return; @@ -305,12 +305,12 @@ ClassTreeMethodItem::ClassTreeMethodItem(ClassTreeItem *parent, ClassTreeItem *l setPixmap(0, UserIcon(icon, KIcon::DefaultState, ClassViewFactory::instance())); } -QString ClassTreeMethodItem::text( int ) const +TQString ClassTreeMethodItem::text( int ) const { - QString str; + TQString str; if ( !m_item ) - return QString::null; + return TQString::null; ParsedMethod* method = static_cast(m_item); @@ -340,7 +340,7 @@ ClassTreeAttrItem::ClassTreeAttrItem(ClassTreeItem *parent, ClassTreeItem *lastS ParsedAttribute *parsedAttr) : ClassTreeItem(parent, lastSibling, parsedAttr) { - QString icon; + TQString icon; if ( !parsedAttr ) return; @@ -360,10 +360,10 @@ ClassTreeAttrItem::ClassTreeAttrItem(ClassTreeItem *parent, ClassTreeItem *lastS } -QString ClassTreeAttrItem::text( int ) const +TQString ClassTreeAttrItem::text( int ) const { if ( !m_item ) - return QString::null; + return TQString::null; return m_item->name(); } @@ -371,7 +371,7 @@ ClassTreeScriptItem::ClassTreeScriptItem(ClassTreeItem *parent, ClassTreeItem *l ParsedScript *parsedScript) : ClassTreeItem(parent, lastSibling, parsedScript) { - QString icon; + TQString icon; if ( !parsedScript ) return; @@ -384,10 +384,10 @@ ClassTreeScriptItem::ClassTreeScriptItem(ClassTreeItem *parent, ClassTreeItem *l } -QString ClassTreeScriptItem::text( int ) const +TQString ClassTreeScriptItem::text( int ) const { if ( !m_item ) - return QString::null; + return TQString::null; return m_item->name(); } @@ -402,14 +402,14 @@ void ClassTreeScriptItem::setOpen(bool o) ClassTreeItem *lastItem = 0; // Add methods - QValueList methodList = pClass->getSortedMethodList(); - QValueList::ConstIterator methodIt; + TQValueList methodList = pClass->getSortedMethodList(); + TQValueList::ConstIterator methodIt; for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt) lastItem = new ClassTreeMethodItem(this, lastItem, *methodIt); // Add attributes - QValueList attrList = pClass->getSortedAttributeList(); - QValueList::ConstIterator attrIt; + TQValueList attrList = pClass->getSortedAttributeList(); + TQValueList::ConstIterator attrIt; for (attrIt = attrList.begin(); attrIt != attrList.end(); ++attrIt) lastItem = new ClassTreeAttrItem(this, lastItem, *attrIt); @@ -422,51 +422,51 @@ void ClassTreeScriptItem::setOpen(bool o) class ClassToolTip : public QToolTip { public: - ClassToolTip( QWidget *parent ) - : QToolTip(parent) + ClassToolTip( TQWidget *parent ) + : TQToolTip(parent) {} protected: - void maybeTip(const QPoint &p); + void maybeTip(const TQPoint &p); }; -void ClassToolTip::maybeTip(const QPoint &p) +void ClassToolTip::maybeTip(const TQPoint &p) { ClassTreeBase *ctw = static_cast(parentWidget()); - QListViewItem *item = ctw->itemAt(p); - QRect r = ctw->itemRect(item); + TQListViewItem *item = ctw->itemAt(p); + TQRect r = ctw->itemRect(item); if (item && r.isValid()) { ClassTreeItem *ctitem = static_cast(item); - QString str = ctitem->tipText(); + TQString str = ctitem->tipText(); if (!str.isEmpty()) tip(r, str); } } -ClassTreeBase::ClassTreeBase(ClassViewPart *part, QWidget *parent, const char *name) +ClassTreeBase::ClassTreeBase(ClassViewPart *part, TQWidget *parent, const char *name) : KListView(parent, name) { setFocusPolicy(ClickFocus); setRootIsDecorated(true); - setResizeMode(QListView::LastColumn); + setResizeMode(TQListView::LastColumn); setSorting(-1); header()->hide(); - addColumn(QString::null); + addColumn(TQString::null); (void) new ClassToolTip(this); - connect( this, SIGNAL(executed(QListViewItem*)), - this, SLOT(slotItemExecuted(QListViewItem*)) ); - connect( this, SIGNAL(mouseButtonPressed(int, QListViewItem*, const QPoint&, int)), - this, SLOT(slotItemPressed(int, QListViewItem*)) ); - connect( this, SIGNAL(returnPressed( QListViewItem*)), - SLOT( slotItemExecuted(QListViewItem*)) ); - connect( this, SIGNAL(contextMenuRequested(QListViewItem*, const QPoint&, int)), - this, SLOT(slotContextMenuRequested(QListViewItem*, const QPoint&)) ); + connect( this, TQT_SIGNAL(executed(TQListViewItem*)), + this, TQT_SLOT(slotItemExecuted(TQListViewItem*)) ); + connect( this, TQT_SIGNAL(mouseButtonPressed(int, TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(slotItemPressed(int, TQListViewItem*)) ); + connect( this, TQT_SIGNAL(returnPressed( TQListViewItem*)), + TQT_SLOT( slotItemExecuted(TQListViewItem*)) ); + connect( this, TQT_SIGNAL(contextMenuRequested(TQListViewItem*, const TQPoint&, int)), + this, TQT_SLOT(slotContextMenuRequested(TQListViewItem*, const TQPoint&)) ); m_part = part; } @@ -481,11 +481,11 @@ ClassTreeBase::TreeState ClassTreeBase::treeState() const TreeState state; ClassTreeBase *that = const_cast(this); - QListViewItemIterator it(that); + TQListViewItemIterator it(that); for (; it.current(); ++it) if (it.current()->isOpen()) { - QStringList path; - QListViewItem *item = it.current(); + TQStringList path; + TQListViewItem *item = it.current(); while (item) { path.prepend(item->text(0)); item = item->parent(); @@ -501,10 +501,10 @@ void ClassTreeBase::setTreeState(TreeState state) { TreeStateIterator tsit; for (tsit = state.begin(); tsit != state.end(); ++tsit) { - QListViewItemIterator it(this); + TQListViewItemIterator it(this); for (; it.current(); ++it) { - QStringList path; - QListViewItem *item = it.current(); + TQStringList path; + TQListViewItem *item = it.current(); while (item) { path.prepend(item->text(0)); item = item->parent(); @@ -520,7 +520,7 @@ void ClassTreeBase::setTreeState(TreeState state) -void ClassTreeBase::slotItemExecuted( QListViewItem* item ) +void ClassTreeBase::slotItemExecuted( TQListViewItem* item ) { if (!item) return; @@ -535,7 +535,7 @@ void ClassTreeBase::slotItemExecuted( QListViewItem* item ) if (ctitem->isOrganizer()) return; - QString toFile; + TQString toFile; int toLine = -1; if (dynamic_cast(item)) { ctitem->getDeclaration(&toFile, &toLine); @@ -548,7 +548,7 @@ void ClassTreeBase::slotItemExecuted( QListViewItem* item ) } -void ClassTreeBase::slotItemPressed(int button, QListViewItem *item) +void ClassTreeBase::slotItemPressed(int button, TQListViewItem *item) { if (!item) return; @@ -560,7 +560,7 @@ void ClassTreeBase::slotItemPressed(int button, QListViewItem *item) return; if (button == MidButton) { - QString toFile; + TQString toFile; int toLine = -1; ctitem->getDeclaration(&toFile, &toLine); m_part->partController()->editDocument(toFile, toLine); @@ -568,7 +568,7 @@ void ClassTreeBase::slotItemPressed(int button, QListViewItem *item) } } -void ClassTreeBase::slotContextMenuRequested(QListViewItem *item, const QPoint &p) +void ClassTreeBase::slotContextMenuRequested(TQListViewItem *item, const TQPoint &p) { contextItem = static_cast(item); @@ -579,7 +579,7 @@ void ClassTreeBase::slotContextMenuRequested(QListViewItem *item, const QPoint & void ClassTreeBase::slotGotoDeclaration() { - QString toFile; + TQString toFile; int toLine = -1; contextItem->getDeclaration(&toFile, &toLine); @@ -589,7 +589,7 @@ void ClassTreeBase::slotGotoDeclaration() void ClassTreeBase::slotGotoImplementation() { - QString toFile; + TQString toFile; int toLine = -1; contextItem->getImplementation(&toFile, &toLine); -- cgit v1.2.1