summaryrefslogtreecommitdiffstats
path: root/parts/classview/classtreebase.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:56:07 +0000
commitd6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch)
treed109539636691d7b03036ca1c0ed29dbae6577cf /parts/classview/classtreebase.cpp
parent3331a47a9cad24795c7440ee8107143ce444ef34 (diff)
downloadtdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz
tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'parts/classview/classtreebase.cpp')
-rw-r--r--parts/classview/classtreebase.cpp174
1 files changed, 87 insertions, 87 deletions
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 <qtooltip.h>
-#include <qheader.h>
-#include <qregexp.h>
+#include <tqtooltip.h>
+#include <tqheader.h>
+#include <tqregexp.h>
#include <kdebug.h>
#include <kconfig.h>
#include <kpopupmenu.h>
@@ -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<ParsedScopeContainer*> scopeList = pScope->getSortedScopeList();
- QValueList<ParsedScopeContainer*>::ConstIterator it;
+ TQValueList<ParsedScopeContainer*> scopeList = pScope->getSortedScopeList();
+ TQValueList<ParsedScopeContainer*>::ConstIterator it;
for (it = scopeList.begin(); it != scopeList.end(); ++it)
lastItem = new ClassTreeScopeItem(this, lastItem, *it);
if (features & KDevLanguageSupport::Classes) {
// Add classes
- QValueList<ParsedClass*> classList = pScope->getSortedClassList();
- QValueList<ParsedClass*>::ConstIterator it;
+ TQValueList<ParsedClass*> classList = pScope->getSortedClassList();
+ TQValueList<ParsedClass*>::ConstIterator it;
for (it = classList.begin(); it != classList.end(); ++it)
lastItem = new ClassTreeClassItem(this, lastItem, *it);
}
if (features & KDevLanguageSupport::Structs) {
// Add structs
- QValueList<ParsedClass*> structList = pScope->getSortedStructList();
- QValueList<ParsedClass*>::ConstIterator it;
+ TQValueList<ParsedClass*> structList = pScope->getSortedStructList();
+ TQValueList<ParsedClass*>::ConstIterator it;
for (it = structList.begin(); it != structList.end(); ++it)
lastItem = new ClassTreeClassItem(this, lastItem, *it, true);
}
if (features & KDevLanguageSupport::Functions) {
// Add functions
- QValueList<ParsedMethod*> methodList = pScope->getSortedMethodList();
- QValueList<ParsedMethod*>::ConstIterator it;
+ TQValueList<ParsedMethod*> methodList = pScope->getSortedMethodList();
+ TQValueList<ParsedMethod*>::ConstIterator it;
for (it = methodList.begin(); it != methodList.end(); ++it)
lastItem = new ClassTreeMethodItem(this, lastItem, *it);
}
if (features & KDevLanguageSupport::Variables) {
// Add attributes
- QValueList<ParsedAttribute*> attrList = pScope->getSortedAttributeList();
- QValueList<ParsedAttribute*>::ConstIterator it;
+ TQValueList<ParsedAttribute*> attrList = pScope->getSortedAttributeList();
+ TQValueList<ParsedAttribute*>::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<ParsedClass*> classList = pClass->getSortedClassList();
- QValueList<ParsedClass*>::ConstIterator classIt;
+ TQValueList<ParsedClass*> classList = pClass->getSortedClassList();
+ TQValueList<ParsedClass*>::ConstIterator classIt;
for (classIt = classList.begin(); classIt != classList.end(); ++classIt)
lastItem = new ClassTreeClassItem(this, lastItem, *classIt);
// Add nested structs
- QValueList<ParsedClass*> structList = pClass->getSortedStructList();
- QValueList<ParsedClass*>::ConstIterator structIt;
+ TQValueList<ParsedClass*> structList = pClass->getSortedStructList();
+ TQValueList<ParsedClass*>::ConstIterator structIt;
for (structIt = structList.begin(); structIt != structList.end(); ++structIt)
lastItem = new ClassTreeClassItem(this, lastItem, *structIt, true);
// Add methods
- QValueList<ParsedMethod*> methodList = pClass->getSortedMethodList();
- QValueList<ParsedMethod*>::ConstIterator methodIt;
+ TQValueList<ParsedMethod*> methodList = pClass->getSortedMethodList();
+ TQValueList<ParsedMethod*>::ConstIterator methodIt;
for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt)
lastItem = new ClassTreeMethodItem(this, lastItem, *methodIt);
// Add slots
- QValueList<ParsedMethod*> slotList = pClass->getSortedSlotList();
- QValueList<ParsedMethod*>::ConstIterator slotIt;
+ TQValueList<ParsedMethod*> slotList = pClass->getSortedSlotList();
+ TQValueList<ParsedMethod*>::ConstIterator slotIt;
for (slotIt = slotList.begin(); slotIt != slotList.end(); ++slotIt)
lastItem = new ClassTreeMethodItem(this, lastItem, *slotIt);
// Add signals
- QValueList<ParsedMethod*> signalList = pClass->getSortedSignalList();
- QValueList<ParsedMethod*>::ConstIterator signalIt;
+ TQValueList<ParsedMethod*> signalList = pClass->getSortedSignalList();
+ TQValueList<ParsedMethod*>::ConstIterator signalIt;
for (signalIt = signalList.begin(); signalIt != signalList.end(); ++signalIt)
lastItem = new ClassTreeMethodItem(this, lastItem, *signalIt);
// Add attributes
- QValueList<ParsedAttribute*> attrList = pClass->getSortedAttributeList();
- QValueList<ParsedAttribute*>::ConstIterator attrIt;
+ TQValueList<ParsedAttribute*> attrList = pClass->getSortedAttributeList();
+ TQValueList<ParsedAttribute*>::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<ParsedMethod*>(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<ParsedMethod*> methodList = pClass->getSortedMethodList();
- QValueList<ParsedMethod*>::ConstIterator methodIt;
+ TQValueList<ParsedMethod*> methodList = pClass->getSortedMethodList();
+ TQValueList<ParsedMethod*>::ConstIterator methodIt;
for (methodIt = methodList.begin(); methodIt != methodList.end(); ++methodIt)
lastItem = new ClassTreeMethodItem(this, lastItem, *methodIt);
// Add attributes
- QValueList<ParsedAttribute*> attrList = pClass->getSortedAttributeList();
- QValueList<ParsedAttribute*>::ConstIterator attrIt;
+ TQValueList<ParsedAttribute*> attrList = pClass->getSortedAttributeList();
+ TQValueList<ParsedAttribute*>::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<ClassTreeBase*>(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<ClassTreeItem*>(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<ClassTreeBase*>(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<ClassTreeClassItem*>(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<ClassTreeItem*>(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);