summaryrefslogtreecommitdiffstats
path: root/kdat/ktreeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdat/ktreeview.cpp')
-rw-r--r--kdat/ktreeview.cpp284
1 files changed, 142 insertions, 142 deletions
diff --git a/kdat/ktreeview.cpp b/kdat/ktreeview.cpp
index 90d445e..70955e9 100644
--- a/kdat/ktreeview.cpp
+++ b/kdat/ktreeview.cpp
@@ -49,7 +49,7 @@ KTreeViewItem::KTreeViewItem(const TQString& theText) :
doTree(true),
doText(true),
child(0),
- parent(0),
+ tqparent(0),
sibling(0),
deleteChildren(false)
{
@@ -67,7 +67,7 @@ KTreeViewItem::KTreeViewItem(const TQString& theText,
doTree(true),
doText(true),
child(0),
- parent(0),
+ tqparent(0),
sibling(0),
deleteChildren(false)
{
@@ -79,7 +79,7 @@ KTreeViewItem::KTreeViewItem(const TQString& theText,
KTreeViewItem::~KTreeViewItem()
{
if (deleteChildren) {
- // remove the children
+ // remove the tqchildren
KTreeViewItem* i = child;
while (i) {
KTreeViewItem* d = i;
@@ -92,7 +92,7 @@ KTreeViewItem::~KTreeViewItem()
// appends a direct child
void KTreeViewItem::appendChild(KTreeViewItem* newChild)
{
- newChild->parent = this;
+ newChild->tqparent = this;
newChild->owner = owner;
if (!getChild()) {
child = newChild;
@@ -121,7 +121,7 @@ TQRect KTreeViewItem::boundingRect(int indent) const
}
// returns the child item at the specified index
-KTreeViewItem* KTreeViewItem::childAt(int index) const
+KTreeViewItem* KTreeViewItem::tqchildAt(int index) const
{
if (!hasChild())
return 0;
@@ -133,7 +133,7 @@ KTreeViewItem* KTreeViewItem::childAt(int index) const
return item;
}
-// returns the number of children this item has
+// returns the number of tqchildren this item has
uint KTreeViewItem::childCount() const
{
return numChildren;
@@ -155,7 +155,7 @@ int KTreeViewItem::childIndex(KTreeViewItem* searched) const
// indicates whether mouse press is in expand button
inline bool KTreeViewItem::expandButtonClicked(const TQPoint& coord) const
{
- return expandButton.contains(coord);
+ return expandButton.tqcontains(coord);
}
bool KTreeViewItem::mousePressEvent( const TQPoint& )
@@ -169,10 +169,10 @@ KTreeViewItem* KTreeViewItem::getChild() const
return child;
}
-// returns the parent of this item
+// returns the tqparent of this item
KTreeViewItem* KTreeViewItem::getParent() const
{
- return parent;
+ return tqparent;
}
// returns reference to the item pixmap
@@ -193,16 +193,16 @@ const TQString& KTreeViewItem::getText() const
return text;
}
-// indicates whether this item has any children
+// indicates whether this item has any tqchildren
bool KTreeViewItem::hasChild() const
{
return child != 0;
}
-// indicates whether this item has a parent
+// indicates whether this item has a tqparent
bool KTreeViewItem::hasParent() const
{
- return parent != 0;
+ return tqparent != 0;
}
// indicates whether this item has a sibling below it
@@ -234,7 +234,7 @@ void KTreeViewItem::insertChild(int index, KTreeViewItem* newChild)
appendChild(newChild);
return;
}
- newChild->parent = this;
+ newChild->tqparent = this;
newChild->owner = owner;
if (index == 0) {
newChild->sibling = getChild();
@@ -260,7 +260,7 @@ void KTreeViewItem::insertChild(int index, KTreeViewItem* newChild)
// indicates whether this item is displayed expanded
// NOTE: a TRUE response does not necessarily indicate the item
-// has any children
+// has any tqchildren
bool KTreeViewItem::isExpanded() const
{
return expanded;
@@ -314,41 +314,41 @@ void KTreeViewItem::paint(TQPainter* p, int indent, const TQColorGroup& cg,
void KTreeViewItem::paintExpandButton(TQPainter* p, int indent, int cellHeight) const
{
- int parentLeaderX = indent - (22 / 2);
+ int tqparentLeaderX = indent - (22 / 2);
int cellCenterY = cellHeight / 2;
- expandButton.setRect(parentLeaderX - 4, cellCenterY - 4, 9, 9);
- p->setBrush(Qt::white);
+ expandButton.setRect(tqparentLeaderX - 4, cellCenterY - 4, 9, 9);
+ p->setBrush(TQt::white);
p->drawRect(expandButton);
if (expanded) {
- p->drawLine(parentLeaderX - 2, cellCenterY,
- parentLeaderX + 2, cellCenterY);
+ p->drawLine(tqparentLeaderX - 2, cellCenterY,
+ tqparentLeaderX + 2, cellCenterY);
} else {
- p->drawLine(parentLeaderX - 2, cellCenterY,
- parentLeaderX + 2, cellCenterY);
- p->drawLine(parentLeaderX, cellCenterY - 2,
- parentLeaderX, cellCenterY + 2);
+ p->drawLine(tqparentLeaderX - 2, cellCenterY,
+ tqparentLeaderX + 2, cellCenterY);
+ p->drawLine(tqparentLeaderX, cellCenterY - 2,
+ tqparentLeaderX, cellCenterY + 2);
}
- p->setBrush(Qt::NoBrush);
+ p->setBrush(TQt::NoBrush);
}
// paint the highlight
-void KTreeViewItem::paintHighlight(TQPainter* p, int indent, const TQColorGroup& colorGroup,
- bool hasFocus, Qt::GUIStyle style) const
+void KTreeViewItem::paintHighlight(TQPainter* p, int indent, const TQColorGroup& tqcolorGroup,
+ bool hasFocus, TQt::GUIStyle style) const
{
TQColor fc;
- if (style == Qt::WindowsStyle)
- fc = Qt::darkBlue; /* hardcoded in Qt */
+ if (style == TQt::WindowsStyle)
+ fc = TQt::darkBlue; /* hardcoded in TQt */
else
- fc = colorGroup.text();
+ fc = tqcolorGroup.text();
TQRect textRect = textBoundingRect(indent);
int t,l,b,r;
textRect.coords(&l, &t, &r, &b);
p->fillRect(textRect, fc); /* draw highlight background */
if (hasFocus) {
- if(style == Qt::WindowsStyle) { /* draw Windows style highlight */
+ if(style == TQt::WindowsStyle) { /* draw Windows style highlight */
textRect.setCoords(l - 1, t - 1, r + 1, b + 1);
- p->setPen(TQPen(Qt::yellow, 0, Qt::DotLine));
+ p->setPen(TQPen(TQt::yellow, 0, TQt::DotLine));
p->setBackgroundColor(fc);
p->setBackgroundMode(Qt::OpaqueMode);
p->drawRect(textRect);
@@ -372,7 +372,7 @@ void KTreeViewItem::paintText(TQPainter* p, int indent, int cellHeight,
p->fontMetrics().leading()) / 2);
if (highlighted) {
paintHighlight(p, indent, cg, owner->hasFocus(),
- (Qt::GUIStyle)owner->style().styleHint(TQStyle::SH_GUIStyle)); // Qt3 doesn't make this easy ;)
+ (TQt::GUIStyle)owner->tqstyle().tqstyleHint(TQStyle::SH_GUIStyle)); // TQt3 doesn't make this easy ;)
p->setPen(cg.base());
p->setBackgroundColor(cg.text());
}
@@ -386,43 +386,43 @@ void KTreeViewItem::paintText(TQPainter* p, int indent, int cellHeight,
// paint the tree structure
void KTreeViewItem::paintTree(TQPainter* p, int indent, int cellHeight) const
{
- int parentLeaderX = indent - (22 / 2);
+ int tqparentLeaderX = indent - (22 / 2);
int cellCenterY = cellHeight / 2;
int cellBottomY = cellHeight - 1;
int itemLeaderX = indent - 3;
/*
* If this is not the first item in the tree draw the line up
- * towards parent or sibling.
+ * towards tqparent or sibling.
*/
- if (parent->parent != 0 || parent->getChild() != this)
- p->drawLine(parentLeaderX, 0, parentLeaderX, cellCenterY);
+ if (tqparent->tqparent != 0 || tqparent->getChild() != this)
+ p->drawLine(tqparentLeaderX, 0, tqparentLeaderX, cellCenterY);
// draw the line down towards sibling
if (sibling)
- p->drawLine(parentLeaderX, cellCenterY, parentLeaderX, cellBottomY);
+ p->drawLine(tqparentLeaderX, cellCenterY, tqparentLeaderX, cellBottomY);
/*
- * If this item has children or siblings in the tree or is a child of
+ * If this item has tqchildren or siblings in the tree or is a child of
* an item other than the root item then draw the little line from the
* item out to the left.
*/
if (sibling || (doExpandButton && (child || delayedExpanding)) ||
- parent->parent != 0 ||
+ tqparent->tqparent != 0 ||
/*
* The following handles the case of an item at the end of the
- * topmost level which doesn't have children.
+ * topmost level which doesn't have tqchildren.
*/
- parent->getChild() != this)
+ tqparent->getChild() != this)
{
- p->drawLine(parentLeaderX, cellCenterY, itemLeaderX, cellCenterY);
+ p->drawLine(tqparentLeaderX, cellCenterY, itemLeaderX, cellCenterY);
}
/*
* If there are siblings of ancestors below, draw our portion of the
* branches that extend through this cell.
*/
- KTreeViewItem* prevRoot = parent;
+ KTreeViewItem* prevRoot = tqparent;
while (prevRoot->getParent() != 0) { /* while not root item */
if (prevRoot->hasSibling()) {
int sibLeaderX = owner->indentation(prevRoot) - (22 / 2);
@@ -435,7 +435,7 @@ void KTreeViewItem::paintTree(TQPainter* p, int indent, int cellHeight) const
// removes the given (direct) child from the branch
bool KTreeViewItem::removeChild(KTreeViewItem* theChild)
{
- // search item in list of children
+ // search item in list of tqchildren
KTreeViewItem* prevItem = 0;
KTreeViewItem* toRemove = getChild();
while (toRemove && toRemove != theChild) {
@@ -573,10 +573,10 @@ int KTreeViewItem::width(int indent, const TQFontMetrics& fm) const
*/
// constructor
-KTreeView::KTreeView(TQWidget *parent,
+KTreeView::KTreeView(TQWidget *tqparent,
const char *name,
WFlags f) :
- TQGridView(parent, name, f),
+ TQGridView(tqparent, name, f),
clearing(false),
current(-1),
drawExpandButton(true),
@@ -599,7 +599,7 @@ KTreeView::KTreeView(TQWidget *parent,
//case WindowsStyle:
//case MotifStyle:
setFrameStyle(TQFrame::WinPanel | TQFrame::Sunken);
- setBackgroundColor(colorGroup().base());
+ setBackgroundColor(tqcolorGroup().base());
//break;
/*default:
setFrameStyle(TQFrame::Panel | TQFrame::Plain);
@@ -646,25 +646,25 @@ void KTreeView::appendChildItem(const TQString & theText, const TQPixmap& thePix
appendChildItem(item, thePath);
}
-// appends the given item to the children of the item at the given index
+// appends the given item to the tqchildren of the item at the given index
void KTreeView::appendChildItem(KTreeViewItem* newItem, int index)
{
- /* find parent item and append new item to parent's sub tree */
- KTreeViewItem* parentItem = itemAt(index);
- if (!parentItem)
+ /* find tqparent item and append new item to tqparent's sub tree */
+ KTreeViewItem* tqparentItem = itemAt(index);
+ if (!tqparentItem)
return;
- appendChildItem(parentItem, newItem);
+ appendChildItem(tqparentItem, newItem);
}
-// appends the given item to the children of the item at the end of the
+// appends the given item to the tqchildren of the item at the end of the
// given path
void KTreeView::appendChildItem(KTreeViewItem* newItem, const KPath& thePath)
{
- /* find parent item and append new item to parent's sub tree */
- KTreeViewItem* parentItem = itemAt(thePath);
- if (!parentItem)
+ /* find tqparent item and append new item to tqparent's sub tree */
+ KTreeViewItem* tqparentItem = itemAt(thePath);
+ if (!tqparentItem)
return;
- appendChildItem(parentItem, newItem);
+ appendChildItem(tqparentItem, newItem);
}
// indicates whether horizontal scrollbar appears only when needed
@@ -744,7 +744,7 @@ void KTreeView::clear()
if(goingDown || TQApplication::closingDown())
return;
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
@@ -789,7 +789,7 @@ int KTreeView::expandLevel() const
// expands or collapses the subtree rooted at the given item,
// as approptiate
-// if item has no children, does nothing
+// if item has no tqchildren, does nothing
void KTreeView::expandOrCollapseItem(int index)
{
KTreeViewItem *item = itemAt(index);
@@ -813,7 +813,7 @@ bool KTreeView::forEveryItem(KForEvery func, void* user, KTreeViewItem* item)
if ((*func)(item, user)) {
return true;
}
- // visit the children (recursively)
+ // visit the tqchildren (recursively)
if (item->hasChild()) {
if (forEveryItem(func, user, item))
return true;
@@ -833,7 +833,7 @@ bool KTreeView::forEveryVisibleItem(KForEvery func, void *user,
if (item == 0) {
item = treeRoot;
} else {
- // children are invisible (hence, nothing to do)
+ // tqchildren are invisible (hence, nothing to do)
// if item is invisible or collapsed
if (!item->isVisible() || !item->isExpanded()) {
return false;
@@ -847,7 +847,7 @@ bool KTreeView::forEveryVisibleItem(KForEvery func, void *user,
if ((*func)(item, user)) {
return true;
}
- // visit the children (recursively)
+ // visit the tqchildren (recursively)
if (item->hasChild() && item->isExpanded()) {
if (forEveryVisibleItem(func, user, item))
return true;
@@ -994,7 +994,7 @@ int KTreeView::itemRow(KTreeViewItem* item)
/*
* move the subtree at the specified index up one branch level (make root
- * item a sibling of its current parent)
+ * item a sibling of its current tqparent)
*/
void KTreeView::join(int index)
{
@@ -1005,7 +1005,7 @@ void KTreeView::join(int index)
/*
* move the subtree at the specified index up one branch level (make root
- * item a sibling of it's current parent)
+ * item a sibling of it's current tqparent)
*/
void KTreeView::join(const KPath& path)
{
@@ -1014,7 +1014,7 @@ void KTreeView::join(const KPath& path)
join(item);
}
-/* move item at specified index one slot down in its parent's sub tree */
+/* move item at specified index one slot down in its tqparent's sub tree */
void KTreeView::lowerItem(int index)
{
KTreeViewItem *item = itemAt(index);
@@ -1022,7 +1022,7 @@ void KTreeView::lowerItem(int index)
lowerItem(item);
}
-/* move item at specified path one slot down in its parent's sub tree */
+/* move item at specified path one slot down in its tqparent's sub tree */
void KTreeView::lowerItem(const KPath& path)
{
KTreeViewItem* item = itemAt(path);
@@ -1030,7 +1030,7 @@ void KTreeView::lowerItem(const KPath& path)
lowerItem(item);
}
-/* move item at specified index one slot up in its parent's sub tree */
+/* move item at specified index one slot up in its tqparent's sub tree */
void KTreeView::raiseItem(int index)
{
KTreeViewItem* item = itemAt(index);
@@ -1038,7 +1038,7 @@ void KTreeView::raiseItem(int index)
raiseItem(item);
}
-/* move item at specified path one slot up in its parent's sub tree */
+/* move item at specified path one slot up in its tqparent's sub tree */
void KTreeView::raiseItem(const KPath& path)
{
KTreeViewItem* item = itemAt(path);
@@ -1113,7 +1113,7 @@ void KTreeView::setExpandButtonDrawing(bool enable)
drawExpandButton = enable;
forEveryItem(&KTreeView::setItemExpandButtonDrawing, 0);
if(autoUpdate() && isVisible())
- repaint();
+ tqrepaint();
}
// sets depth to which subtrees are automatically expanded, and
@@ -1132,10 +1132,10 @@ void KTreeView::setExpandLevel(int level)
}
setCurrentItem(itemRow(item));
if(autoUpdate() && isVisible())
- repaint();
+ tqrepaint();
}
-// sets the indent margin for all branches and repaints if auto update enabled
+// sets the indent margin for all branches and tqrepaints if auto update enabled
void KTreeView::setIndentSpacing(int spacing)
{
if (itemIndent == spacing)
@@ -1143,7 +1143,7 @@ void KTreeView::setIndentSpacing(int spacing)
itemIndent = spacing;
updateCellWidth();
if (autoUpdate() && isVisible())
- repaint();
+ tqrepaint();
}
// enables/disables vertical scrollbar
@@ -1160,7 +1160,7 @@ void KTreeView::setShowItemText(bool enable)
showText = enable;
forEveryItem(&KTreeView::setItemShowText, 0);
if(autoUpdate() && isVisible())
- repaint();
+ tqrepaint();
}
// indicates whether vertical scrolling is by pixel or row
@@ -1177,7 +1177,7 @@ void KTreeView::setTreeDrawing(bool enable)
drawTree = enable;
forEveryItem(&KTreeView::setItemTreeDrawing, 0);
if(autoUpdate() && isVisible())
- repaint();
+ tqrepaint();
}
// indicates whether item text keys are displayed
@@ -1237,7 +1237,7 @@ bool KTreeView::treeDrawing() const
}
-// appends a child to the specified parent item (note: a child, not a sibling, is added!)
+// appends a child to the specified tqparent item (note: a child, not a sibling, is added!)
void KTreeView::appendChildItem(KTreeViewItem* theParent,
KTreeViewItem* newItem)
{
@@ -1251,18 +1251,18 @@ void KTreeView::appendChildItem(KTreeViewItem* theParent,
newItem->setExpanded(true);
}
- // fix up branch levels of any children that the new item may already have
+ // fix up branch levels of any tqchildren that the new item may already have
if(newItem->hasChild()) {
fixChildren(newItem);
}
- // if necessary, adjust cell width, number of rows and repaint
+ // if necessary, adjust cell width, number of rows and tqrepaint
if (newItem->isVisible() || theParent->childCount() == 1) {
bool autoU = autoUpdate();
setAutoUpdate(false);
updateVisibleItems();
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
}
@@ -1302,7 +1302,7 @@ void KTreeView::collapseSubTree(KTreeViewItem* subRoot)
}
}
// roland
- repaint();
+ tqrepaint();
setAutoUpdate(TRUE);
// roland
}
@@ -1317,21 +1317,21 @@ bool KTreeView::countItem(KTreeViewItem*, void* total)
}
// if item is expanded, collapses it or vice-versa
-void KTreeView::expandOrCollapse(KTreeViewItem* parent)
+void KTreeView::expandOrCollapse(KTreeViewItem* tqparent)
{
bool autoU = autoUpdate();
setAutoUpdate(false);
- int parentIndex = itemRow(parent);
- if (parent->isExpanded()) {
- collapseSubTree(parent);
- emit collapsed(parentIndex);
+ int tqparentIndex = itemRow(tqparent);
+ if (tqparent->isExpanded()) {
+ collapseSubTree(tqparent);
+ emit collapsed(tqparentIndex);
}
else {
- expandSubTree(parent);
- emit expanded(parentIndex);
+ expandSubTree(tqparent);
+ emit expanded(tqparentIndex);
}
if (autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
@@ -1361,28 +1361,28 @@ void KTreeView::expandSubTree(KTreeViewItem* subRoot)
}
}
// roland
- repaint();
+ tqrepaint();
setAutoUpdate(TRUE);
// roland
}
// fix up branch levels out of whack from split/join operations on the tree
-void KTreeView::fixChildren(KTreeViewItem *parentItem)
+void KTreeView::fixChildren(KTreeViewItem *tqparentItem)
{
KTreeViewItem* childItem = 0;
KTreeViewItem* siblingItem = 0;
-// int childBranch = parentItem->getBranch() + 1;
- if(parentItem->hasChild()) {
- childItem = parentItem->getChild();
+// int childBranch = tqparentItem->getBranch() + 1;
+ if(tqparentItem->hasChild()) {
+ childItem = tqparentItem->getChild();
// childItem->setBranch(childBranch);
- childItem->owner = parentItem->owner;
+ childItem->owner = tqparentItem->owner;
fixChildren(childItem);
}
while(childItem && childItem->hasSibling()) {
siblingItem = childItem->getSibling();
// siblingItem->setBranch(childBranch);
- siblingItem->owner = parentItem->owner;
+ siblingItem->owner = tqparentItem->owner;
fixChildren(siblingItem);
childItem = siblingItem;
}
@@ -1483,37 +1483,37 @@ bool KTreeView::insertItem(KTreeViewItem* referenceItem,
{
setCellHeight(newItem->height(fontMetrics()));
}
- KTreeViewItem* parentItem;
+ KTreeViewItem* tqparentItem;
if (referenceItem) {
- parentItem = referenceItem->getParent();
- int insertIndex = parentItem->childIndex(referenceItem);
+ tqparentItem = referenceItem->getParent();
+ int insertIndex = tqparentItem->childIndex(referenceItem);
if (!prefix)
insertIndex++;
- parentItem->insertChild(insertIndex, newItem);
+ tqparentItem->insertChild(insertIndex, newItem);
}
else {
// no reference item, append at end of visible tree
- // need to repaint
- parentItem = treeRoot;
- parentItem->appendChild(newItem);
+ // need to tqrepaint
+ tqparentItem = treeRoot;
+ tqparentItem->appendChild(newItem);
}
// set item expansion
if (level(newItem) < expansion)
newItem->setExpanded(true);
- // fix up branch levels of any children
+ // fix up branch levels of any tqchildren
if (newItem->hasChild())
fixChildren(newItem);
- // if repaint necessary, do it if visible and auto update
+ // if tqrepaint necessary, do it if visible and auto update
// enabled
- if (newItem->isVisible() || parentItem->childCount() == 1) {
+ if (newItem->isVisible() || tqparentItem->childCount() == 1) {
bool autoU = autoUpdate();
setAutoUpdate(FALSE);
updateVisibleItems();
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
return true;
@@ -1534,7 +1534,7 @@ void KTreeView::itemPath(KTreeViewItem* item, KPath& path) const
/*
* joins the item's branch into the tree, making the item a sibling of its
- * parent
+ * tqparent
*/
void KTreeView::join(KTreeViewItem *item)
{
@@ -1545,7 +1545,7 @@ void KTreeView::join(KTreeViewItem *item)
takeItem(item);
insertItem(itemParent, item, FALSE);
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
}
@@ -1587,16 +1587,16 @@ void KTreeView::keyPressEvent(TQKeyEvent *e)
// move highlight one page down and scroll down
- delta = QMAX(1, visibleHeight() / cellHeight());
- setCurrentItem(QMIN(currentItem() + delta, numRows() - 1));
+ delta = TQMAX(1, visibleHeight() / cellHeight());
+ setCurrentItem(TQMIN(currentItem() + delta, numRows() - 1));
ensureCellVisible(currentItem(), 0);
break;
case Key_Prior:
// move highlight one page up and scroll up
- delta = QMAX(1, visibleHeight() / cellHeight());
- setCurrentItem(QMAX(currentItem() - delta, 0));
+ delta = TQMAX(1, visibleHeight() / cellHeight());
+ setCurrentItem(TQMAX(currentItem() - delta, 0));
ensureCellVisible(currentItem(), 0);
break;
case Key_Plus:
@@ -1632,15 +1632,15 @@ int KTreeView::level(KTreeViewItem* item) const
assert(item->owner == this);
assert(item != treeRoot);
int l = 0;
- item = item->parent->parent; /* since item != treeRoot, there is a parent */
+ item = item->tqparent->tqparent; /* since item != treeRoot, there is a tqparent */
while (item != 0) {
- item = item->parent;
+ item = item->tqparent;
l++;
}
return l;
}
-/* move specified item down one slot in parent's subtree */
+/* move specified item down one slot in tqparent's subtree */
void KTreeView::lowerItem(KTreeViewItem *item)
{
KTreeViewItem *itemParent = item->getParent();
@@ -1649,9 +1649,9 @@ void KTreeView::lowerItem(KTreeViewItem *item)
bool autoU = autoUpdate();
setAutoUpdate(FALSE);
takeItem(item);
- insertItem(itemParent->childAt(itemChildIndex), item, FALSE);
+ insertItem(itemParent->tqchildAt(itemChildIndex), item, FALSE);
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
}
@@ -1681,7 +1681,7 @@ void KTreeView::mouseDoubleClickEvent(TQMouseEvent *e)
// hit test item
int indent = indentation(item);
- if(item->boundingRect(indent).contains(cellCoord))
+ if(item->boundingRect(indent).tqcontains(cellCoord))
emit selected(itemClicked);
}
@@ -1701,7 +1701,7 @@ void KTreeView::mousePressEvent(TQMouseEvent *e)
{
// first: check which button was pressed
- if (e->button() == MidButton)
+ if (e->button() == Qt::MidButton)
{
// RB: the MMB is hardcoded to the "rubberband" scroll mode
if (!rubberband_mode) {
@@ -1709,7 +1709,7 @@ void KTreeView::mousePressEvent(TQMouseEvent *e)
}
return;
}
- else if ( ( rubberband_mode ) && ( e->button() != RightButton ) )
+ else if ( ( rubberband_mode ) && ( e->button() != Qt::RightButton ) )
{
// another button was pressed while rubberbanding, stop the move.
// RB: if we allow other buttons while rubberbanding the tree can expand
@@ -1749,9 +1749,9 @@ void KTreeView::mousePressEvent(TQMouseEvent *e)
emit selected(itemClicked);
}
// hit item (to show info on the file/dir label clicked)
- else if (item->boundingRect(indentation(item)).contains(cellCoord)) {
+ else if (item->boundingRect(indentation(item)).tqcontains(cellCoord)) {
setCurrentItem(itemClicked); // highlight item
- if ( e->button() == RightButton ) {
+ if ( e->button() == Qt::RightButton ) {
emit popupMenu( itemClicked, mapToGlobal( TQPoint( e->pos().x(), e->pos().y() ) ) );
}
}
@@ -1761,7 +1761,7 @@ void KTreeView::mousePressEvent(TQMouseEvent *e)
void KTreeView::mouseReleaseEvent(TQMouseEvent *e)
{
/* if it's the MMB end rubberbanding */
- if (rubberband_mode && e->button()==MidButton)
+ if (rubberband_mode && e->button()==Qt::MidButton)
{
end_rubberband();
}
@@ -1859,14 +1859,14 @@ void KTreeView::paintCell(TQPainter* p, int row, int)
return;
p->setClipRect(cellRect(), TQPainter::CoordPainter );
- TQColorGroup cg = colorGroup();
+ TQColorGroup cg = tqcolorGroup();
int indent = indentation(item);
item->paint(p, indent, cg,
current == row); /* highlighted */
p->setClipping(false);
}
-/* raise the specified item up one slot in parent's subtree */
+/* raise the specified item up one slot in tqparent's subtree */
void KTreeView::raiseItem(KTreeViewItem *item)
{
KTreeViewItem *itemParent = item->getParent();
@@ -1875,9 +1875,9 @@ void KTreeView::raiseItem(KTreeViewItem *item)
bool autoU = autoUpdate();
setAutoUpdate(FALSE);
takeItem(item);
- insertItem(itemParent->childAt(--itemChildIndex), item, TRUE);
+ insertItem(itemParent->tqchildAt(--itemChildIndex), item, TRUE);
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
}
@@ -1891,15 +1891,15 @@ KTreeViewItem* KTreeView::recursiveFind(KPath& path)
// get the next key
TQString* searchString = path.pop();
- // find the parent item
- KTreeViewItem* parent = recursiveFind(path);
- if (parent == 0)
+ // find the tqparent item
+ KTreeViewItem* tqparent = recursiveFind(path);
+ if (tqparent == 0)
return 0;
/*
- * Iterate through the parent's children searching for searchString.
+ * Iterate through the tqparent's tqchildren searching for searchString.
*/
- KTreeViewItem* sibling = parent->getChild();
+ KTreeViewItem* sibling = tqparent->getChild();
while (sibling != 0) {
if (*searchString == sibling->getText()) {
break; /* found it! */
@@ -1961,9 +1961,9 @@ void KTreeView::split(KTreeViewItem *item)
bool autoU = autoUpdate();
setAutoUpdate(FALSE);
takeItem(item);
- appendChildItem(itemParent->childAt(--itemChildIndex), item);
+ appendChildItem(itemParent->tqchildAt(--itemChildIndex), item);
if(autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
@@ -1988,22 +1988,22 @@ void KTreeView::takeItem(KTreeViewItem* item)
c = c->getParent();
}
if (c != 0) {
- // move current item to parent
+ // move current item to tqparent
cur = item->getParent();
if (cur == treeRoot)
cur = 0;
}
}
- KTreeViewItem* parentItem = item->getParent();
- parentItem->removeChild(item);
+ KTreeViewItem* tqparentItem = item->getParent();
+ tqparentItem->removeChild(item);
item->sibling = 0;
- if (wasVisible || parentItem->childCount() == 0) {
+ if (wasVisible || tqparentItem->childCount() == 0) {
bool autoU = autoUpdate();
setAutoUpdate(FALSE);
updateVisibleItems();
if (autoU && isVisible())
- repaint();
+ tqrepaint();
setAutoUpdate(autoU);
}
@@ -2012,7 +2012,7 @@ void KTreeView::takeItem(KTreeViewItem* item)
}
// visits each item, calculates the maximum width
-// and updates QGridView
+// and updates TQGridView
void KTreeView::updateCellWidth()
{
// make cells at least 1 pixel wide to avoid singularities (division by zero)
@@ -2041,10 +2041,10 @@ void KTreeView::updateVisibleItemRec(KTreeViewItem* item, int& index, int& count
}
/*
- * Record the children of item in the list of visible items.
+ * Record the tqchildren of item in the list of visible items.
*
* Don't register item itself, it's already in the list. Also only
- * allocate new space for children.
+ * allocate new space for tqchildren.
*/
count += item->childCount();
if (count > itemCapacity) {
@@ -2066,7 +2066,7 @@ void KTreeView::updateVisibleItemRec(KTreeViewItem* item, int& index, int& count
visibleItems = newItems;
itemCapacity = newCapacity;
}
- // insert children
+ // insert tqchildren
for (KTreeViewItem* i = item->getChild(); i != 0; i = i->getSibling()) {
visibleItems[index++] = i;
updateVisibleItemRec(i, index, count);