From e86f8310a920cbf1ecfac955fbad05916e954693 Mon Sep 17 00:00:00 2001 From: tpearson Date: Thu, 30 Jun 2011 19:20:52 +0000 Subject: TQt4 port knowit This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knowit@1238876 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/knowittree.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/knowittree.cpp') diff --git a/src/knowittree.cpp b/src/knowittree.cpp index ad260fb..055b1b9 100644 --- a/src/knowittree.cpp +++ b/src/knowittree.cpp @@ -16,14 +16,14 @@ ***************************************************************************/ #include -#include -#include -#include -#include +#include +#include +#include +#include #include "knowittree.h" -KnowitTree::KnowitTree(QWidget* parent, const char* name) - : KListView(parent, name) +KnowitTree::KnowitTree(TQWidget* tqparent, const char* name) + : KListView(tqparent, name) { setMinimumSize(150, 150); addColumn(i18n("Notes")); @@ -35,25 +35,25 @@ KnowitTree::KnowitTree(QWidget* parent, const char* name) setSorting(-1); setDragAutoScroll(true); prevItem = 0; - QWhatsThis::add(this, i18n("

Notes hierarchy

" + TQWhatsThis::add(this, i18n("

Notes hierarchy

" "Here you can browse notes tree. " "You can also add notes using right-click menu, or reorganize them using " "drag and drop.")); } -void KnowitTree::takeNode(QListViewItem* item) +void KnowitTree::takeNode(TQListViewItem* item) { - if (item->parent()) - item->parent()->takeItem(item); + if (item->tqparent()) + item->tqparent()->takeItem(item); else takeItem(item); } -void KnowitTree::insertNode(QListViewItem* parent, QListViewItem* item, QListViewItem* after) +void KnowitTree::insertNode(TQListViewItem* tqparent, TQListViewItem* item, TQListViewItem* after) { - if (parent) - parent->insertItem(item); + if (tqparent) + tqparent->insertItem(item); else insertItem(item); if (after) @@ -61,9 +61,9 @@ void KnowitTree::insertNode(QListViewItem* parent, QListViewItem* item, QListVie } -void KnowitTree::contentsDragMoveEvent(QDragMoveEvent* event) +void KnowitTree::contentsDragMoveEvent(TQDragMoveEvent* event) { - QListViewItem* item = itemAt(event->pos()); + TQListViewItem* item = itemAt(event->pos()); /* check if on root decoration */ if (!item || event->pos().x() > header()->cellPos(header()->mapToActual(0)) + treeStepSize() * (item->depth() + 1) + itemMargin() || @@ -75,7 +75,7 @@ void KnowitTree::contentsDragMoveEvent(QDragMoveEvent* event) void KnowitTree::slotCollapseAll() { - QListViewItem* it = firstChild(); + TQListViewItem* it = firstChild(); while(it) { it->setOpen(false); it = it->nextSibling(); @@ -91,7 +91,7 @@ void KnowitTree::slotCollapse() void KnowitTree::slotExpandAll() { - QListViewItem* it = firstChild(); + TQListViewItem* it = firstChild(); while(it) { it->setOpen(true); it = it->nextSibling(); @@ -123,7 +123,7 @@ void KnowitTree::slotItemBegin() void KnowitTree::slotItemEnd() { - QListViewItem* elt = firstChild(); + TQListViewItem* elt = firstChild(); if (elt) while (elt->itemBelow()) elt = elt->itemBelow(); @@ -133,7 +133,7 @@ void KnowitTree::slotItemEnd() void KnowitTree::slotItemLeft() { if (currentItem()) - setCurrentItem(currentItem()->parent()); + setCurrentItem(currentItem()->tqparent()); } void KnowitTree::slotItemRight() -- cgit v1.2.3