diff options
Diffstat (limited to 'konq-plugins/fsview/treemap.cpp')
-rw-r--r-- | konq-plugins/fsview/treemap.cpp | 302 |
1 files changed, 151 insertions, 151 deletions
diff --git a/konq-plugins/fsview/treemap.cpp b/konq-plugins/fsview/treemap.cpp index 5a42c75..b3f6cb6 100644 --- a/konq-plugins/fsview/treemap.cpp +++ b/konq-plugins/fsview/treemap.cpp @@ -51,7 +51,7 @@ StoredDrawParams::StoredDrawParams() _shaded = true; _rotated = false; - _backColor = Qt::white; + _backColor = TQt::white; // field array has size 0 } @@ -72,7 +72,7 @@ StoredDrawParams::StoredDrawParams(TQColor c, TQString StoredDrawParams::text(int f) const { if ((f<0) || (f >= (int)_field.size())) - return TQString::null; + return TQString(); return _field[f].text; } @@ -266,7 +266,7 @@ void RectDrawing::drawBack(TQPainter* p, DrawParams* dp) if (dp->shaded()) { // some shading - bool goDark = qGray(normal.rgb())>128; + bool goDark = tqGray(normal.rgb())>128; int rBase, gBase, bBase; normal.rgb(&rBase, &gBase, &bBase); p->setBrush(TQBrush::NoBrush); @@ -525,7 +525,7 @@ bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp) } p->save(); - p->setPen( (qGray(dp->backColor().rgb())>100) ? Qt::black : Qt::white); + p->setPen( (tqGray(dp->backColor().rgb())>100) ? TQt::black : TQt::white); p->setFont(dp->font()); if (rotate) { //p->translate(r.x()+2, r.y()+r.height()); @@ -616,7 +616,7 @@ bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp) } } else - remaining = TQString::null; + remaining = TQString(); /* truncate and add ... if needed */ if (w>width) { @@ -655,7 +655,7 @@ bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp) p->drawText( x+pixW, y, width - pixW, h, - Qt::AlignLeft, name); + TQt::AlignLeft, name); y = isBottom ? (y-h) : (y+h); lines--; @@ -717,11 +717,11 @@ int TreeMapItemList::compareItems ( Item item1, Item item2 ) bool ascending; int result; - TreeMapItem* parent = ((TreeMapItem*)item1)->parent(); + TreeMapItem* tqparent = ((TreeMapItem*)item1)->tqparent(); // shouldn't happen - if (!parent) return 0; + if (!tqparent) return 0; - int textNo = parent->sorting(&ascending); + int textNo = tqparent->sorting(&ascending); if (textNo < 0) { double diff = ((TreeMapItem*)item1)->value() - @@ -738,25 +738,25 @@ int TreeMapItemList::compareItems ( Item item1, Item item2 ) TreeMapItem* TreeMapItemList::commonParent() { - TreeMapItem* parent, *item; - parent = first(); - if (parent) + TreeMapItem* tqparent, *item; + tqparent = first(); + if (tqparent) while( (item = next()) != 0) - parent = parent->commonParent(item); + tqparent = tqparent->commonParent(item); - return parent; + return tqparent; } // TreeMapItem -TreeMapItem::TreeMapItem(TreeMapItem* parent, double value) +TreeMapItem::TreeMapItem(TreeMapItem* tqparent, double value) { _value = value; - _parent = parent; + _parent = tqparent; _sum = 0; - _children = 0; + _tqchildren = 0; _widget = 0; _index = -1; _depth = -1; // not set @@ -764,7 +764,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value) _freeRects = 0; if (_parent) { - // take sorting from parent + // take sorting from tqparent _sortTextNo = _parent->sorting(&_sortAscending); _parent->addItem(this); } @@ -775,12 +775,12 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value) } -TreeMapItem::TreeMapItem(TreeMapItem* parent, double value, +TreeMapItem::TreeMapItem(TreeMapItem* tqparent, double value, TQString text1, TQString text2, TQString text3, TQString text4) { _value = value; - _parent = parent; + _parent = tqparent; // this resizes the text vector only if needed if (!text4.isEmpty()) setText(3, text4); @@ -789,7 +789,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value, setText(0, text1); _sum = 0; - _children = 0; + _tqchildren = 0; _widget = 0; _index = -1; _depth = -1; // not set @@ -801,7 +801,7 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value, TreeMapItem::~TreeMapItem() { - if (_children) delete _children; + if (_tqchildren) delete _tqchildren; if (_freeRects) delete _freeRects; // finally, notify widget about deletion @@ -829,7 +829,7 @@ bool TreeMapItem::isChildOf(TreeMapItem* item) TreeMapItem* TreeMapItem::commonParent(TreeMapItem* item) { while (item && !isChildOf(item)) { - item = item->parent(); + item = item->tqparent(); } return item; } @@ -842,18 +842,18 @@ void TreeMapItem::redraw() void TreeMapItem::clear() { - if (_children) { + if (_tqchildren) { // delete selected items below this item from selection if (_widget) _widget->clearSelection(this); - delete _children; - _children = 0; + delete _tqchildren; + _tqchildren = 0; } } -// invalidates current children and forces redraw -// this is only usefull when children are created on demand in items() +// tqinvalidates current tqchildren and forces redraw +// this is only usefull when tqchildren are created on demand in items() void TreeMapItem::refresh() { clear(); @@ -887,9 +887,9 @@ int TreeMapItem::depth() const bool TreeMapItem::initialized() { - if (!_children) { - _children = new TreeMapItemList; - _children->setAutoDelete(true); + if (!_tqchildren) { + _tqchildren = new TreeMapItemList; + _tqchildren->setAutoDelete(true); return false; } return true; @@ -899,16 +899,16 @@ void TreeMapItem::addItem(TreeMapItem* i) { if (!i) return; - if (!_children) { - _children = new TreeMapItemList; - _children->setAutoDelete(true); + if (!_tqchildren) { + _tqchildren = new TreeMapItemList; + _tqchildren->setAutoDelete(true); } i->setParent(this); if (sorting(0) == -1) - _children->append(i); // preserve insertion order + _tqchildren->append(i); // preserve insertion order else - _children->inSort(i); + _tqchildren->inSort(i); } @@ -974,17 +974,17 @@ void TreeMapItem::setSorting(int textNo, bool ascending) _sortAscending = ascending; _sortTextNo = textNo; - if (_children && _sortTextNo != -1) _children->sort(); + if (_tqchildren && _sortTextNo != -1) _tqchildren->sort(); } void TreeMapItem::resort(bool recursive) { - if (!_children) return; + if (!_tqchildren) return; - if (_sortTextNo != -1) _children->sort(); + if (_sortTextNo != -1) _tqchildren->sort(); if (recursive) - for (TreeMapItem* i=_children->first(); i; i=_children->next()) + for (TreeMapItem* i=_tqchildren->first(); i; i=_tqchildren->next()) i->resort(recursive); } @@ -1002,13 +1002,13 @@ int TreeMapItem::rtti() const return 0; } -TreeMapItemList* TreeMapItem::children() +TreeMapItemList* TreeMapItem::tqchildren() { - if (!_children) { - _children = new TreeMapItemList; - _children->setAutoDelete(true); + if (!_tqchildren) { + _tqchildren = new TreeMapItemList; + _tqchildren->setAutoDelete(true); } - return _children; + return _tqchildren; } void TreeMapItem::clearItemRect() @@ -1072,7 +1072,7 @@ void TreeMapItem::addFreeRect(const TQRect& r) // Tooltips for TreeMapWidget -class TreeMapTip: public QToolTip +class TreeMapTip: public TQToolTip { public: TreeMapTip( TQWidget* p ):TQToolTip(p) {} @@ -1083,17 +1083,17 @@ protected: void TreeMapTip::maybeTip( const TQPoint& pos ) { - if ( !parentWidget()->inherits( "TreeMapWidget" ) ) + if ( !tqparentWidget()->inherits( "TreeMapWidget" ) ) return; - TreeMapWidget* p = (TreeMapWidget*)parentWidget(); + TreeMapWidget* p = (TreeMapWidget*)tqparentWidget(); TreeMapItem* i; i = p->item(pos.x(), pos.y()); TQPtrList<TQRect>* rList = i ? i->freeRects() : 0; if (rList) { TQRect* r; for(r=rList->first();r;r=rList->next()) - if (r->contains(pos)) + if (r->tqcontains(pos)) tip(*r, p->tipString(i)); } } @@ -1103,8 +1103,8 @@ void TreeMapTip::maybeTip( const TQPoint& pos ) // TreeMapWidget TreeMapWidget::TreeMapWidget(TreeMapItem* base, - TQWidget* parent, const char* name) - : TQWidget(parent, name) + TQWidget* tqparent, const char* name) + : TQWidget(tqparent, name) { _base = base; _base->setWidget(this); @@ -1139,8 +1139,8 @@ TreeMapWidget::TreeMapWidget(TreeMapItem* base, _lastOver = 0; _needsRefresh = _base; - setBackgroundMode(Qt::NoBackground); - setFocusPolicy(TQWidget::StrongFocus); + setBackgroundMode(TQt::NoBackground); + setFocusPolicy(TQ_StrongFocus); _tip = new TreeMapTip(this); } @@ -1252,7 +1252,7 @@ void TreeMapWidget::setMaxDrawingDepth(int d) TQString TreeMapWidget::defaultFieldType(int f) const { - return i18n("Text %1").arg(f+1); + return i18n("Text %1").tqarg(f+1); } TQString TreeMapWidget::defaultFieldStop(int) const @@ -1433,10 +1433,10 @@ void TreeMapWidget::setMinimalArea(int area) void TreeMapWidget::deletingItem(TreeMapItem* i) { // remove any references to the item to be deleted - while(_selection.findRef(i) > -1) + while(_selection.tqfindRef(i) > -1) _selection.remove(); - while(_tmpSelection.findRef(i) > -1) + while(_tmpSelection.tqfindRef(i) > -1) _tmpSelection.remove(); if (_current == i) _current = 0; @@ -1446,9 +1446,9 @@ void TreeMapWidget::deletingItem(TreeMapItem* i) // don't redraw a deleted item if (_needsRefresh == i) { - // we can savely redraw the parent, as deleting order is - // from child to parent; i.e. i->parent() is existing. - _needsRefresh = i->parent(); + // we can savely redraw the tqparent, as deleting order is + // from child to tqparent; i.e. i->tqparent() is existing. + _needsRefresh = i->tqparent(); } } @@ -1468,7 +1468,7 @@ TQString TreeMapWidget::tipString(TreeMapItem* i) const tip += itemTip; } - i = i->parent(); + i = i->tqparent(); } return tip; } @@ -1478,11 +1478,11 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const TreeMapItem* p = _base; TreeMapItem* i; - if (!rect().contains(x, y)) return 0; + if (!TQT_TQRECT_OBJECT(rect()).tqcontains(x, y)) return 0; if (DEBUG_DRAWING) kdDebug(90100) << "item(" << x << "," << y << "):" << endl; while (1) { - TreeMapItemList* list = p->children(); + TreeMapItemList* list = p->tqchildren(); if (!list) i = 0; else { @@ -1491,11 +1491,11 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const if (DEBUG_DRAWING) kdDebug(90100) << " Checking " << i->path(0).join("/") << " (" - << i->itemRect().x() << "/" << i->itemRect().y() - << "-" << i->itemRect().width() - << "x" << i->itemRect().height() << ")" << endl; + << i->tqitemRect().x() << "/" << i->tqitemRect().y() + << "-" << i->tqitemRect().width() + << "x" << i->tqitemRect().height() << ")" << endl; - if (i->itemRect().contains(x, y)) { + if (i->tqitemRect().tqcontains(x, y)) { if (DEBUG_DRAWING) kdDebug(90100) << " .. Got. Index " << idx << endl; @@ -1513,7 +1513,7 @@ TreeMapItem* TreeMapWidget::item(int x, int y) const if (DEBUG_DRAWING) kdDebug(90100) << "item(" << x << "," << y << "): Got " << p->path(0).join("/") << " (Size " - << p->itemRect().width() << "x" << p->itemRect().height() + << p->tqitemRect().width() << "x" << p->tqitemRect().height() << ", Val " << p->value() << ")" << endl; } @@ -1530,7 +1530,7 @@ TreeMapItem* TreeMapWidget::possibleSelection(TreeMapItem* i) const if (_maxSelectDepth>=0) { int depth = i->depth(); while(i && depth > _maxSelectDepth) { - i = i->parent(); + i = i->tqparent(); depth--; } } @@ -1542,16 +1542,16 @@ TreeMapItem* TreeMapWidget::visibleItem(TreeMapItem* i) const { if (i) { /* Must have a visible area */ - while(i && ((i->itemRect().width() <1) || - (i->itemRect().height() <1))) { - TreeMapItem* p = i->parent(); + while(i && ((i->tqitemRect().width() <1) || + (i->tqitemRect().height() <1))) { + TreeMapItem* p = i->tqparent(); if (!p) break; - int idx = p->children()->findRef(i); + int idx = p->tqchildren()->tqfindRef(i); idx--; if (idx<0) i = p; else - i = p->children()->at(idx); + i = p->tqchildren()->at(idx); } } return i; @@ -1596,12 +1596,12 @@ TreeMapItemList TreeMapWidget::diff(TreeMapItemList& l1, TreeMapItem* item; while ( (item = it1.current()) != 0 ) { ++it1; - if (l2.containsRef(item) > 0) continue; + if (l2.tqcontainsRef(item) > 0) continue; l.append(item); } while ( (item = it2.current()) != 0 ) { ++it2; - if (l1.containsRef(item) > 0) continue; + if (l1.tqcontainsRef(item) > 0) continue; l.append(item); } @@ -1644,13 +1644,13 @@ TreeMapItem* TreeMapWidget::setTmpSelected(TreeMapItem* item, bool selected) } -bool TreeMapWidget::clearSelection(TreeMapItem* parent) +bool TreeMapWidget::clearSelection(TreeMapItem* tqparent) { TreeMapItemList old = _selection; TreeMapItem* i=_selection.first(); while (i) { - if (i->isChildOf(parent)) { + if (i->isChildOf(tqparent)) { _selection.remove(); i = _selection.current(); } @@ -1668,12 +1668,12 @@ bool TreeMapWidget::clearSelection(TreeMapItem* parent) bool TreeMapWidget::isSelected(TreeMapItem* i) const { - return _selection.containsRef(i)>0; + return _selection.tqcontainsRef(i)>0; } bool TreeMapWidget::isTmpSelected(TreeMapItem* i) { - return _tmpSelection.containsRef(i)>0; + return _tmpSelection.tqcontainsRef(i)>0; } @@ -1738,14 +1738,14 @@ TreeMapItem* TreeMapWidget::setTmpRangeSelection(TreeMapItem* i1, TreeMapItem* commonParent = i1; while (commonParent && !i2->isChildOf(commonParent)) { i1 = commonParent; - commonParent = commonParent->parent(); + commonParent = commonParent->tqparent(); } if (!commonParent) return changed; - while (i2 && i2->parent() != commonParent) - i2 = i2->parent(); + while (i2 && i2->tqparent() != commonParent) + i2 = i2->tqparent(); if (!i2) return changed; - TreeMapItemList* list = commonParent->children(); + TreeMapItemList* list = commonParent->tqchildren(); if (!list) return changed; TreeMapItem* i = list->first(); @@ -1768,11 +1768,11 @@ void TreeMapWidget::contextMenuEvent( TQContextMenuEvent* e ) { //kdDebug(90100) << "TreeMapWidget::contextMenuEvent" << endl; - if ( receivers( TQT_SIGNAL(contextMenuRequested(TreeMapItem*, const TQPoint &)) ) ) + if ( tqreceivers( TQT_SIGNAL(contextMenuRequested(TreeMapItem*, const TQPoint &)) ) ) e->accept(); if ( e->reason() == TQContextMenuEvent::Keyboard ) { - TQRect r = (_current) ? _current->itemRect() : _base->itemRect(); + TQRect r = (_current) ? _current->tqitemRect() : _base->tqitemRect(); TQPoint p = TQPoint(r.left() + r.width()/2, r.top() + r.height()/2); emit contextMenuRequested(_current, p); } @@ -1826,7 +1826,7 @@ void TreeMapWidget::mousePressEvent( TQMouseEvent* e ) } // item under mouse always selected on right button press - if (e->button() == RightButton) { + if (e->button() == Qt::RightButton) { TreeMapItem* changed2 = setTmpSelected(item, true); if (changed2) changed = changed2->commonParent(changed); } @@ -1836,7 +1836,7 @@ void TreeMapWidget::mousePressEvent( TQMouseEvent* e ) if (changed) redraw(changed); - if (e->button() == RightButton) { + if (e->button() == Qt::RightButton) { // emit selection change if (! (_tmpSelection == _selection)) { @@ -1935,15 +1935,15 @@ void TreeMapWidget::mouseDoubleClickEvent( TQMouseEvent* e ) /* returns -1 if nothing visible found */ int nextVisible(TreeMapItem* i) { - TreeMapItem* p = i->parent(); - if (!p || p->itemRect().isEmpty()) return -1; + TreeMapItem* p = i->tqparent(); + if (!p || p->tqitemRect().isEmpty()) return -1; - int idx = p->children()->findRef(i); + int idx = p->tqchildren()->tqfindRef(i); if (idx<0) return -1; - while (idx < (int)p->children()->count()-1) { + while (idx < (int)p->tqchildren()->count()-1) { idx++; - TQRect r = p->children()->at(idx)->itemRect(); + TQRect r = p->tqchildren()->at(idx)->tqitemRect(); if (r.width()>1 && r.height()>1) return idx; } @@ -1953,15 +1953,15 @@ int nextVisible(TreeMapItem* i) /* returns -1 if nothing visible found */ int prevVisible(TreeMapItem* i) { - TreeMapItem* p = i->parent(); - if (!p || p->itemRect().isEmpty()) return -1; + TreeMapItem* p = i->tqparent(); + if (!p || p->tqitemRect().isEmpty()) return -1; - int idx = p->children()->findRef(i); + int idx = p->tqchildren()->tqfindRef(i); if (idx<0) return -1; while (idx > 0) { idx--; - TQRect r = p->children()->at(idx)->itemRect(); + TQRect r = p->tqchildren()->at(idx)->tqitemRect(); if (r.width()>1 && r.height()>1) return idx; } @@ -2024,7 +2024,7 @@ void TreeMapWidget::keyPressEvent( TQKeyEvent* e ) } TreeMapItem* old = _current, *newItem; - TreeMapItem* p = _current->parent(); + TreeMapItem* p = _current->tqparent(); bool goBack; if (_current->sorting(&goBack) == -1) { @@ -2042,24 +2042,24 @@ void TreeMapWidget::keyPressEvent( TQKeyEvent* e ) int newIdx = goBack ? nextVisible(_current) : prevVisible(_current); if (p && newIdx>=0) { p->setIndex(newIdx); - setCurrent(p->children()->at(newIdx), true); + setCurrent(p->tqchildren()->at(newIdx), true); } } else if (e->key() == Key_Right) { int newIdx = goBack ? prevVisible(_current) : nextVisible(_current); if (p && newIdx>=0) { p->setIndex(newIdx); - setCurrent(p->children()->at(newIdx), true); + setCurrent(p->tqchildren()->at(newIdx), true); } } else if (e->key() == Key_Down) { - if (_current->children() && _current->children()->count()>0) { + if (_current->tqchildren() && _current->tqchildren()->count()>0) { int newIdx = _current->index(); if (newIdx<0) - newIdx = goBack ? (_current->children()->count()-1) : 0; - if (newIdx>=(int)_current->children()->count()) - newIdx = _current->children()->count()-1; - newItem = visibleItem(_current->children()->at(newIdx)); + newIdx = goBack ? (_current->tqchildren()->count()-1) : 0; + if (newIdx>=(int)_current->tqchildren()->count()) + newIdx = _current->tqchildren()->count()-1; + newItem = visibleItem(_current->tqchildren()->at(newIdx)); setCurrent(newItem, true); } } @@ -2136,7 +2136,7 @@ void TreeMapWidget::drawTreeMap() } else { // only subitem - if (!_needsRefresh->itemRect().isValid()) return; + if (!_needsRefresh->tqitemRect().isValid()) return; } // reset cached font object; it could have been changed @@ -2147,14 +2147,14 @@ void TreeMapWidget::drawTreeMap() _needsRefresh = 0; } - bitBlt( this, 0, 0, &_pixmap, 0, 0, + bitBlt( TQT_TQPAINTDEVICE(this), 0, 0, TQT_TQPAINTDEVICE(&_pixmap), 0, 0, TQWidget::width(), TQWidget::height(), CopyROP, true); if (hasFocus()) { TQPainter p(this); - style().drawPrimitive( TQStyle::PE_FocusRect, &p, + tqstyle().tqdrawPrimitive( TQStyle::PE_FocusRect, &p, TQRect(0, 0, TQWidget::width(), TQWidget::height()), - colorGroup() ); + tqcolorGroup() ); } } @@ -2184,7 +2184,7 @@ void TreeMapWidget::drawItem(TQPainter* p, TreeMapItem* i; if (_markNo>0) { - for(i = item;i;i=i->parent()) + for(i = item;i;i=i->tqparent()) if (i->isMarked(_markNo)) break; isSelected = (i!=0); @@ -2198,7 +2198,7 @@ void TreeMapWidget::drawItem(TQPainter* p, bool isCurrent = _current && item->isChildOf(_current); - RectDrawing d(item->itemRect()); + RectDrawing d(item->tqitemRect()); item->setSelected(isSelected); item->setCurrent(isCurrent); item->setShaded(_shading); @@ -2232,25 +2232,25 @@ void TreeMapWidget::drawItems(TQPainter* p, { if (DEBUG_DRAWING) kdDebug(90100) << "+drawItems(" << item->path(0).join("/") << ", " - << item->itemRect().x() << "/" << item->itemRect().y() - << "-" << item->itemRect().width() << "x" - << item->itemRect().height() << "), Val " << item->value() + << item->tqitemRect().x() << "/" << item->tqitemRect().y() + << "-" << item->tqitemRect().width() << "x" + << item->tqitemRect().height() << "), Val " << item->value() << ", Sum " << item->sum() << endl; drawItem(p, item); item->clearFreeRects(); - TQRect origRect = item->itemRect(); + TQRect origRect = item->tqitemRect(); int bw = item->borderWidth(); TQRect r = TQRect(origRect.x()+bw, origRect.y()+bw, origRect.width()-2*bw, origRect.height()-2*bw); - TreeMapItemList* list = item->children(); + TreeMapItemList* list = item->tqchildren(); TreeMapItem* i; bool stopDrawing = false; - // only subdivide if there are children + // only subdivide if there are tqchildren if (!list || list->count()==0) stopDrawing = true; @@ -2283,12 +2283,12 @@ void TreeMapWidget::drawItems(TQPainter* p, if (stopDrawing) { if (list) { - // invalidate rects + // tqinvalidate rects for (i=list->first();i;i=list->next()) i->clearItemRect(); } // tooltip apears on whole item rect - item->addFreeRect(item->itemRect()); + item->addFreeRect(item->tqitemRect()); // if we have space for text... if ((r.height() < _fontHeight) || (r.width() < _fontHeight)) return; @@ -2399,7 +2399,7 @@ void TreeMapWidget::drawItems(TQPainter* p, r.setRect(r.x(), r.y()+sr.height(), r.width(), r.height()-sr.height()); } - // set selfRect (not occupied by children) for tooltip + // set selfRect (not occupied by tqchildren) for tooltip item->addFreeRect(sr); if (0) kdDebug(90100) << "Item " << item->path(0).join("/") << ": SelfR " @@ -2537,16 +2537,16 @@ void TreeMapWidget::drawItems(TQPainter* p, kdDebug(90100) << "-drawItems(" << item->path(0).join("/") << ")" << endl; } -// fills area with a pattern if to small to draw children +// fills area with a pattern if to small to draw tqchildren void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r) { - p->setBrush(Qt::Dense4Pattern); - p->setPen(Qt::NoPen); + p->setBrush(TQt::Dense4Pattern); + p->setPen(TQt::NoPen); p->drawRect(r); i->addFreeRect(r); } -// fills area with a pattern if to small to draw children +// fills area with a pattern if to small to draw tqchildren void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r, TreeMapItemListIterator it, int len, bool goBack) { @@ -2555,8 +2555,8 @@ void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r, << "-" << r.width() << "x" << r.height() << ", len " << len << ")" << endl; - p->setBrush(Qt::Dense4Pattern); - p->setPen(Qt::NoPen); + p->setBrush(TQt::Dense4Pattern); + p->setPen(TQt::NoPen); p->drawRect(r); i->addFreeRect(r); @@ -2845,10 +2845,10 @@ void TreeMapWidget::addVisualizationItems(TQPopupMenu* popup, int id) popup->insertItem(i18n("Border"), bpopup, id+1); bpopup->insertItem(i18n("Correct Borders Only"), id+2); bpopup->insertSeparator(); - bpopup->insertItem(i18n("Width %1").arg(0), id+3); - bpopup->insertItem(i18n("Width %1").arg(1), id+4); - bpopup->insertItem(i18n("Width %1").arg(2), id+5); - bpopup->insertItem(i18n("Width %1").arg(3), id+6); + bpopup->insertItem(i18n("Width %1").tqarg(0), id+3); + bpopup->insertItem(i18n("Width %1").tqarg(1), id+4); + bpopup->insertItem(i18n("Width %1").tqarg(2), id+5); + bpopup->insertItem(i18n("Width %1").tqarg(3), id+6); bpopup->setItemChecked(id+2, skipIncorrectBorder()); bpopup->setItemChecked(id+3, borderWidth()==0); bpopup->setItemChecked(id+4, borderWidth()==1); @@ -2906,7 +2906,7 @@ void TreeMapWidget::selectionActivated(int id) TreeMapItem* i = _menuItem; id -= _selectionID; while (id>0 && i) { - i=i->parent(); + i=i->tqparent(); id--; } if (i) @@ -2928,18 +2928,18 @@ void TreeMapWidget::addSelectionItems(TQPopupMenu* popup, TQString name = i->text(0); if (name.isEmpty()) break; popup->insertItem(i->text(0), id++); - i = i->parent(); + i = i->tqparent(); } } void TreeMapWidget::fieldStopActivated(int id) { - if (id == _fieldStopID) setFieldStop(0, TQString::null); + if (id == _fieldStopID) setFieldStop(0, TQString()); else { TreeMapItem* i = _menuItem; id -= _fieldStopID+1; while (id>0 && i) { - i=i->parent(); + i=i->tqparent(); id--; } if (i) @@ -2955,7 +2955,7 @@ void TreeMapWidget::addFieldStopItems(TQPopupMenu* popup, connect(popup, TQT_SIGNAL(activated(int)), this, TQT_SLOT(fieldStopActivated(int))); - popup->insertItem(i18n("No %1 Limit").arg(fieldType(0)), id); + popup->insertItem(i18n("No %1 Limit").tqarg(fieldType(0)), id); popup->setItemChecked(id, fieldStop(0).isEmpty()); _menuItem = i; bool foundFieldStop = false; @@ -2971,7 +2971,7 @@ void TreeMapWidget::addFieldStopItems(TQPopupMenu* popup, popup->setItemChecked(id, true); foundFieldStop = true; } - i = i->parent(); + i = i->tqparent(); } } @@ -3014,7 +3014,7 @@ void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup, int area = i->width() * i->height(); popup->insertSeparator(); popup->insertItem(i18n("Area of '%1' (%2)") - .arg(i->text(0)).arg(area), id+1); + .tqarg(i->text(0)).tqarg(area), id+1); if (area == minimalArea()) { popup->setItemChecked(id+1, true); foundArea = true; @@ -3040,9 +3040,9 @@ void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup, } popup->insertItem(i18n("Double Area Limit (to %1)") - .arg(minimalArea()*2), id+5); + .tqarg(minimalArea()*2), id+5); popup->insertItem(i18n("Halve Area Limit (to %1)") - .arg(minimalArea()/2), id+6); + .tqarg(minimalArea()/2), id+6); } } @@ -3079,7 +3079,7 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup, int d = i->depth(); popup->insertSeparator(); popup->insertItem(i18n("Depth of '%1' (%2)") - .arg(i->text(0)).arg(d), id+1); + .tqarg(i->text(0)).tqarg(d), id+1); if (d == maxDrawingDepth()) { popup->setItemChecked(id+1, true); foundDepth = true; @@ -3089,7 +3089,7 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup, popup->insertSeparator(); int depth = 2, count; for (count=0;count<3;count++) { - popup->insertItem(i18n("Depth %1").arg(depth), id+4+count); + popup->insertItem(i18n("Depth %1").tqarg(depth), id+4+count); if (depth == maxDrawingDepth()) { popup->setItemChecked(id+4+count, true); foundDepth = true; @@ -3100,14 +3100,14 @@ void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup, if (maxDrawingDepth()>1) { popup->insertSeparator(); if (!foundDepth) { - popup->insertItem(i18n("Depth %1").arg(maxDrawingDepth()), id+10); + popup->insertItem(i18n("Depth %1").tqarg(maxDrawingDepth()), id+10); popup->setItemChecked(id+10, true); } popup->insertItem(i18n("Decrement (to %1)") - .arg(maxDrawingDepth()-1), id+2); + .tqarg(maxDrawingDepth()-1), id+2); popup->insertItem(i18n("Increment (to %1)") - .arg(maxDrawingDepth()+1), id+3); + .tqarg(maxDrawingDepth()+1), id+3); } } @@ -3130,13 +3130,13 @@ void TreeMapWidget::saveOptions(KConfigGroup* config, TQString prefix) int f, fCount = _attr.size(); config->writeEntry(prefix+"FieldCount", fCount); for (f=0;f<fCount;f++) { - config->writeEntry(TQString(prefix+"FieldVisible%1").arg(f), + config->writeEntry(TQString(prefix+"FieldVisible%1").tqarg(f), _attr[f].visible); - config->writeEntry(TQString(prefix+"FieldForced%1").arg(f), + config->writeEntry(TQString(prefix+"FieldForced%1").tqarg(f), _attr[f].forced); - config->writeEntry(TQString(prefix+"FieldStop%1").arg(f), + config->writeEntry(TQString(prefix+"FieldStop%1").tqarg(f), _attr[f].stop); - config->writeEntry(TQString(prefix+"FieldPosition%1").arg(f), + config->writeEntry(TQString(prefix+"FieldPosition%1").tqarg(f), fieldPositionString(f)); } } @@ -3180,18 +3180,18 @@ void TreeMapWidget::restoreOptions(KConfigGroup* config, TQString prefix) int f; for (f=0;f<num;f++) { - str = TQString(prefix+"FieldVisible%1").arg(f); + str = TQString(prefix+"FieldVisible%1").tqarg(f); if (config->hasKey(str)) setFieldVisible(f, config->readBoolEntry(str)); - str = TQString(prefix+"FieldForced%1").arg(f); + str = TQString(prefix+"FieldForced%1").tqarg(f); if (config->hasKey(str)) setFieldForced(f, config->readBoolEntry(str)); - str = config->readEntry(TQString(prefix+"FieldStop%1").arg(f)); + str = config->readEntry(TQString(prefix+"FieldStop%1").tqarg(f)); setFieldStop(f, str); - str = config->readEntry(TQString(prefix+"FieldPosition%1").arg(f)); + str = config->readEntry(TQString(prefix+"FieldPosition%1").tqarg(f)); if (!str.isEmpty()) setFieldPosition(f, str); } } |