summaryrefslogtreecommitdiffstats
path: root/kcachegrind/kcachegrind/treemap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kcachegrind/kcachegrind/treemap.cpp')
-rw-r--r--kcachegrind/kcachegrind/treemap.cpp338
1 files changed, 169 insertions, 169 deletions
diff --git a/kcachegrind/kcachegrind/treemap.cpp b/kcachegrind/kcachegrind/treemap.cpp
index 3ccc34f9..fe01c796 100644
--- a/kcachegrind/kcachegrind/treemap.cpp
+++ b/kcachegrind/kcachegrind/treemap.cpp
@@ -18,16 +18,16 @@
/*
* A Widget for visualizing hierarchical metrics as areas.
- * The API is similar to QListView.
+ * The API is similar to TQListView.
*/
#include <math.h>
-#include <qpainter.h>
-#include <qtooltip.h>
-#include <qregexp.h>
-#include <qstyle.h>
-#include <qpopupmenu.h>
+#include <tqpainter.h>
+#include <tqtooltip.h>
+#include <tqregexp.h>
+#include <tqstyle.h>
+#include <tqpopupmenu.h>
#include <klocale.h>
#include <kconfig.h>
@@ -56,7 +56,7 @@ StoredDrawParams::StoredDrawParams()
// field array has size 0
}
-StoredDrawParams::StoredDrawParams(QColor c,
+StoredDrawParams::StoredDrawParams(TQColor c,
bool selected, bool current)
{
_backColor = c;
@@ -70,18 +70,18 @@ StoredDrawParams::StoredDrawParams(QColor c,
// field array has size 0
}
-QString StoredDrawParams::text(int f) const
+TQString StoredDrawParams::text(int f) const
{
if ((f<0) || (f >= (int)_field.size()))
- return QString::null;
+ return TQString::null;
return _field[f].text;
}
-QPixmap StoredDrawParams::pixmap(int f) const
+TQPixmap StoredDrawParams::pixmap(int f) const
{
if ((f<0) || (f >= (int)_field.size()))
- return QPixmap();
+ return TQPixmap();
return _field[f].pix;
}
@@ -102,10 +102,10 @@ int StoredDrawParams::maxLines(int f) const
return _field[f].maxLines;
}
-const QFont& StoredDrawParams::font() const
+const TQFont& StoredDrawParams::font() const
{
- static QFont* f = 0;
- if (!f) f = new QFont(QApplication::font());
+ static TQFont* f = 0;
+ if (!f) f = new TQFont(TQApplication::font());
return *f;
}
@@ -125,7 +125,7 @@ void StoredDrawParams::ensureField(int f)
}
-void StoredDrawParams::setField(int f, const QString& t, QPixmap pm,
+void StoredDrawParams::setField(int f, const TQString& t, TQPixmap pm,
Position p, int maxLines)
{
if (f<0 || f>=MAX_FIELD) return;
@@ -137,7 +137,7 @@ void StoredDrawParams::setField(int f, const QString& t, QPixmap pm,
_field[f].maxLines = maxLines;
}
-void StoredDrawParams::setText(int f, const QString& t)
+void StoredDrawParams::setText(int f, const TQString& t)
{
if (f<0 || f>=MAX_FIELD) return;
ensureField(f);
@@ -145,7 +145,7 @@ void StoredDrawParams::setText(int f, const QString& t)
_field[f].text = t;
}
-void StoredDrawParams::setPixmap(int f, const QPixmap& pm)
+void StoredDrawParams::setPixmap(int f, const TQPixmap& pm)
{
if (f<0 || f>=MAX_FIELD) return;
ensureField(f);
@@ -175,7 +175,7 @@ void StoredDrawParams::setMaxLines(int f, int m)
// RectDrawing
//
-RectDrawing::RectDrawing(QRect r)
+RectDrawing::RectDrawing(TQRect r)
{
_fm = 0;
_dp = 0;
@@ -204,7 +204,7 @@ void RectDrawing::setDrawParams(DrawParams* dp)
_dp = dp;
}
-void RectDrawing::setRect(QRect r)
+void RectDrawing::setRect(TQRect r)
{
_rect = r;
@@ -218,7 +218,7 @@ void RectDrawing::setRect(QRect r)
_fontHeight = 0;
}
-QRect RectDrawing::remainingRect(DrawParams* dp)
+TQRect RectDrawing::remainingRect(DrawParams* dp)
{
if (!dp) dp = drawParams();
@@ -243,20 +243,20 @@ QRect RectDrawing::remainingRect(DrawParams* dp)
}
-void RectDrawing::drawBack(QPainter* p, DrawParams* dp)
+void RectDrawing::drawBack(TQPainter* p, DrawParams* dp)
{
if (!dp) dp = drawParams();
if (_rect.width()<=0 || _rect.height()<=0) return;
- QRect r = _rect;
- QColor normal = dp->backColor();
+ TQRect r = _rect;
+ TQColor normal = dp->backColor();
if (dp->selected()) normal = normal.light();
bool isCurrent = dp->current();
if (dp->drawFrame() || isCurrent) {
// 3D raised/sunken frame effect...
- QColor high = normal.light();
- QColor low = normal.dark();
+ TQColor high = normal.light();
+ TQColor low = normal.dark();
p->setPen( isCurrent ? low:high);
p->drawLine(r.left(), r.top(), r.right(), r.top());
p->drawLine(r.left(), r.top(), r.left(), r.bottom());
@@ -272,7 +272,7 @@ void RectDrawing::drawBack(QPainter* p, DrawParams* dp)
bool goDark = qGray(normal.rgb())>128;
int rBase, gBase, bBase;
normal.rgb(&rBase, &gBase, &bBase);
- p->setBrush(QBrush::NoBrush);
+ p->setBrush(TQBrush::NoBrush);
// shade parameters:
int d = 7;
@@ -293,7 +293,7 @@ void RectDrawing::drawBack(QPainter* p, DrawParams* dp)
int gDiff = goDark ? -gBase/d : (255-gBase)/d;
int bDiff = goDark ? -bBase/d : (255-bBase)/d;
- QColor shadeColor;
+ TQColor shadeColor;
while (factor<.95) {
shadeColor.setRgb((int)(rBase+factor*rDiff+.5),
(int)(gBase+factor*gDiff+.5),
@@ -332,22 +332,22 @@ void RectDrawing::drawBack(QPainter* p, DrawParams* dp)
}
// fill inside
- p->setPen(QPen::NoPen);
+ p->setPen(TQPen::NoPen);
p->setBrush(normal);
p->drawRect(r);
}
-bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
+bool RectDrawing::drawField(TQPainter* p, int f, DrawParams* dp)
{
if (!dp) dp = drawParams();
if (!_fm) {
- _fm = new QFontMetrics(dp->font());
+ _fm = new TQFontMetrics(dp->font());
_fontHeight = _fm->height();
}
- QRect r = _rect;
+ TQRect r = _rect;
if (0) kdDebug(90100) << "DrawField: Rect " << r.x() << "/" << r.y()
<< " - " << r.width() << "x" << r.height() << endl;
@@ -487,9 +487,9 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
// get text and pixmap now, only if we need to, because it is possible
// that they are calculated on demand (and this can take some time)
- QString name = dp->text(f);
+ TQString name = dp->text(f);
if (name.isEmpty()) return 0;
- QPixmap pix = dp->pixmap(f);
+ TQPixmap pix = dp->pixmap(f);
// check if pixmap can be drawn
int pixW = pix.width();
@@ -551,14 +551,14 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
* If the text is to be written at the bottom, we start with the
* end of the string (so everything is reverted)
*/
- QString remaining;
+ TQString remaining;
int origLines = lines;
while (lines>0) {
if (w>width && lines>1) {
int lastBreakPos = name.length(), lastWidth = w;
int len = name.length();
- QChar::Category caOld, ca;
+ TQChar::Category caOld, ca;
if (!isBottom) {
// start with comparing categories of last 2 chars
@@ -568,8 +568,8 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
ca = name[len-1].category();
if (ca != caOld) {
// "Aa" has no break between...
- if (ca == QChar::Letter_Uppercase &&
- caOld == QChar::Letter_Lowercase) {
+ if (ca == TQChar::Letter_Uppercase &&
+ caOld == TQChar::Letter_Lowercase) {
caOld = ca;
continue;
}
@@ -583,7 +583,7 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
w = lastWidth;
remaining = name.mid(lastBreakPos);
// remove space on break point
- if (name[lastBreakPos-1].category() == QChar::Separator_Space)
+ if (name[lastBreakPos-1].category() == TQChar::Separator_Space)
name = name.left(lastBreakPos-1);
else
name = name.left(lastBreakPos);
@@ -597,8 +597,8 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
if (ca != caOld) {
// "Aa" has no break between...
- if (caOld == QChar::Letter_Uppercase &&
- ca == QChar::Letter_Lowercase) {
+ if (caOld == TQChar::Letter_Uppercase &&
+ ca == TQChar::Letter_Lowercase) {
caOld = ca;
continue;
}
@@ -612,14 +612,14 @@ bool RectDrawing::drawField(QPainter* p, int f, DrawParams* dp)
w = lastWidth;
remaining = name.left(l-lastBreakPos);
// remove space on break point
- if (name[l-lastBreakPos].category() == QChar::Separator_Space)
+ if (name[l-lastBreakPos].category() == TQChar::Separator_Space)
name = name.right(lastBreakPos-1);
else
name = name.right(lastBreakPos);
}
}
else
- remaining = QString::null;
+ remaining = TQString::null;
/* truncate and add ... if needed */
if (w>width) {
@@ -779,8 +779,8 @@ TreeMapItem::TreeMapItem(TreeMapItem* parent, double value)
TreeMapItem::TreeMapItem(TreeMapItem* parent, double value,
- QString text1, QString text2,
- QString text3, QString text4)
+ TQString text1, TQString text2,
+ TQString text3, TQString text4)
{
_value = value;
_parent = parent;
@@ -864,13 +864,13 @@ void TreeMapItem::refresh()
}
-QStringList TreeMapItem::path(int textNo) const
+TQStringList TreeMapItem::path(int textNo) const
{
- QStringList list(text(textNo));
+ TQStringList list(text(textNo));
TreeMapItem* i = _parent;
while (i) {
- QString text = i->text(textNo);
+ TQString text = i->text(textNo);
if (!text.isEmpty())
list.prepend(i->text(textNo));
i = i->_parent;
@@ -937,7 +937,7 @@ DrawParams::Position TreeMapItem::position(int f) const
}
// use widget font
-const QFont& TreeMapItem::font() const
+const TQFont& TreeMapItem::font() const
{
return _widget->currentFont();
}
@@ -1016,7 +1016,7 @@ TreeMapItemList* TreeMapItem::children()
void TreeMapItem::clearItemRect()
{
- _rect = QRect();
+ _rect = TQRect();
clearFreeRects();
}
@@ -1025,13 +1025,13 @@ void TreeMapItem::clearFreeRects()
if (_freeRects) _freeRects->clear();
}
-void TreeMapItem::addFreeRect(const QRect& r)
+void TreeMapItem::addFreeRect(const TQRect& r)
{
// don't add invalid rects
if ((r.width() < 1) || (r.height() < 1)) return;
if (!_freeRects) {
- _freeRects = new QPtrList<QRect>;
+ _freeRects = new TQPtrList<TQRect>;
_freeRects->setAutoDelete(true);
}
@@ -1039,9 +1039,9 @@ void TreeMapItem::addFreeRect(const QRect& r)
<< r.x() << "/" << r.y() << "-"
<< r.width() << "x" << r.height() << ")" << endl;
- QRect* last = _freeRects->last();
+ TQRect* last = _freeRects->last();
if (!last) {
- _freeRects->append(new QRect(r));
+ _freeRects->append(new TQRect(r));
return;
}
@@ -1063,7 +1063,7 @@ void TreeMapItem::addFreeRect(const QRect& r)
}
if (!replaced) {
- _freeRects->append(new QRect(r));
+ _freeRects->append(new TQRect(r));
return;
}
@@ -1078,13 +1078,13 @@ void TreeMapItem::addFreeRect(const QRect& r)
class TreeMapTip: public QToolTip
{
public:
- TreeMapTip( QWidget* p ):QToolTip(p) {}
+ TreeMapTip( TQWidget* p ):TQToolTip(p) {}
protected:
- void maybeTip( const QPoint & );
+ void maybeTip( const TQPoint & );
};
-void TreeMapTip::maybeTip( const QPoint& pos )
+void TreeMapTip::maybeTip( const TQPoint& pos )
{
if ( !parentWidget()->inherits( "TreeMapWidget" ) )
return;
@@ -1092,9 +1092,9 @@ void TreeMapTip::maybeTip( const QPoint& pos )
TreeMapWidget* p = (TreeMapWidget*)parentWidget();
TreeMapItem* i;
i = p->item(pos.x(), pos.y());
- QPtrList<QRect>* rList = i ? i->freeRects() : 0;
+ TQPtrList<TQRect>* rList = i ? i->freeRects() : 0;
if (rList) {
- QRect* r;
+ TQRect* r;
for(r=rList->first();r;r=rList->next())
if (r->contains(pos))
tip(*r, p->tipString(i));
@@ -1106,8 +1106,8 @@ void TreeMapTip::maybeTip( const QPoint& pos )
// TreeMapWidget
TreeMapWidget::TreeMapWidget(TreeMapItem* base,
- QWidget* parent, const char* name)
- : QWidget(parent, name)
+ TQWidget* parent, const char* name)
+ : TQWidget(parent, name)
{
_base = base;
_base->setWidget(this);
@@ -1148,7 +1148,7 @@ TreeMapWidget::TreeMapWidget(TreeMapItem* base,
_needsRefresh = _base;
setBackgroundMode(Qt::NoBackground);
- setFocusPolicy(QWidget::StrongFocus);
+ setFocusPolicy(TQWidget::StrongFocus);
_tip = new TreeMapTip(this);
}
@@ -1158,7 +1158,7 @@ TreeMapWidget::~TreeMapWidget()
delete _tip;
}
-const QFont& TreeMapWidget::currentFont() const
+const TQFont& TreeMapWidget::currentFont() const
{
return _font;
}
@@ -1176,7 +1176,7 @@ TreeMapItem::SplitMode TreeMapWidget::splitMode() const
return _splitMode;
}
-bool TreeMapWidget::setSplitMode(QString mode)
+bool TreeMapWidget::setSplitMode(TQString mode)
{
if (mode == "Bisection") setSplitMode(TreeMapItem::Bisection);
else if (mode == "Columns") setSplitMode(TreeMapItem::Columns);
@@ -1192,9 +1192,9 @@ bool TreeMapWidget::setSplitMode(QString mode)
return true;
}
-QString TreeMapWidget::splitModeString() const
+TQString TreeMapWidget::splitModeString() const
{
- QString mode;
+ TQString mode;
switch(splitMode()) {
case TreeMapItem::Bisection: mode = "Bisection"; break;
case TreeMapItem::Columns: mode = "Columns"; break;
@@ -1276,14 +1276,14 @@ void TreeMapWidget::setMaxDrawingDepth(int d)
redraw();
}
-QString TreeMapWidget::defaultFieldType(int f) const
+TQString TreeMapWidget::defaultFieldType(int f) const
{
return i18n("Text %1").arg(f+1);
}
-QString TreeMapWidget::defaultFieldStop(int) const
+TQString TreeMapWidget::defaultFieldStop(int) const
{
- return QString();
+ return TQString();
}
bool TreeMapWidget::defaultFieldVisible(int f) const
@@ -1328,7 +1328,7 @@ bool TreeMapWidget::resizeAttr(int size)
return true;
}
-void TreeMapWidget::setFieldType(int f, QString type)
+void TreeMapWidget::setFieldType(int f, TQString type)
{
if (((int)_attr.size() < f+1) &&
(type == defaultFieldType(f))) return;
@@ -1337,13 +1337,13 @@ void TreeMapWidget::setFieldType(int f, QString type)
// no need to redraw: the type string is not visible in the TreeMap
}
-QString TreeMapWidget::fieldType(int f) const
+TQString TreeMapWidget::fieldType(int f) const
{
if (f<0 || (int)_attr.size()<f+1) return defaultFieldType(f);
return _attr[f].type;
}
-void TreeMapWidget::setFieldStop(int f, QString stop)
+void TreeMapWidget::setFieldStop(int f, TQString stop)
{
if (((int)_attr.size() < f+1) &&
(stop == defaultFieldStop(f))) return;
@@ -1353,7 +1353,7 @@ void TreeMapWidget::setFieldStop(int f, QString stop)
}
}
-QString TreeMapWidget::fieldStop(int f) const
+TQString TreeMapWidget::fieldStop(int f) const
{
if (f<0 || (int)_attr.size()<f+1) return defaultFieldStop(f);
return _attr[f].stop;
@@ -1416,7 +1416,7 @@ DrawParams::Position TreeMapWidget::fieldPosition(int f) const
return _attr[f].pos;
}
-void TreeMapWidget::setFieldPosition(int f, QString pos)
+void TreeMapWidget::setFieldPosition(int f, TQString pos)
{
if (pos == "TopLeft")
setFieldPosition(f, DrawParams::TopLeft);
@@ -1434,17 +1434,17 @@ void TreeMapWidget::setFieldPosition(int f, QString pos)
setFieldPosition(f, DrawParams::Default);
}
-QString TreeMapWidget::fieldPositionString(int f) const
+TQString TreeMapWidget::fieldPositionString(int f) const
{
TreeMapItem::Position pos = fieldPosition(f);
- if (pos == DrawParams::TopLeft) return QString("TopLeft");
- if (pos == DrawParams::TopCenter) return QString("TopCenter");
- if (pos == DrawParams::TopRight) return QString("TopRight");
- if (pos == DrawParams::BottomLeft) return QString("BottomLeft");
- if (pos == DrawParams::BottomCenter) return QString("BottomCenter");
- if (pos == DrawParams::BottomRight) return QString("BottomRight");
- if (pos == DrawParams::Default) return QString("Default");
- return QString("unknown");
+ if (pos == DrawParams::TopLeft) return TQString("TopLeft");
+ if (pos == DrawParams::TopCenter) return TQString("TopCenter");
+ if (pos == DrawParams::TopRight) return TQString("TopRight");
+ if (pos == DrawParams::BottomLeft) return TQString("BottomLeft");
+ if (pos == DrawParams::BottomCenter) return TQString("BottomCenter");
+ if (pos == DrawParams::BottomRight) return TQString("BottomRight");
+ if (pos == DrawParams::Default) return TQString("Default");
+ return TQString("unknown");
}
void TreeMapWidget::setMinimalArea(int area)
@@ -1479,9 +1479,9 @@ void TreeMapWidget::deletingItem(TreeMapItem* i)
}
-QString TreeMapWidget::tipString(TreeMapItem* i) const
+TQString TreeMapWidget::tipString(TreeMapItem* i) const
{
- QString tip, itemTip;
+ TQString tip, itemTip;
while (i) {
if (!i->text(0).isEmpty()) {
@@ -1598,7 +1598,7 @@ void TreeMapWidget::setSelected(TreeMapItem* item, bool selected)
redraw(changed);
if (0) kdDebug(90100) << (selected ? "S":"Des") << "elected Item "
- << (item ? item->path(0).join("") : QString("(null)"))
+ << (item ? item->path(0).join("") : TQString("(null)"))
<< " (depth " << (item ? item->depth() : -1)
<< ")" << endl;
}
@@ -1790,16 +1790,16 @@ TreeMapItem* TreeMapWidget::setTmpRangeSelection(TreeMapItem* i1,
return changed;
}
-void TreeMapWidget::contextMenuEvent( QContextMenuEvent* e )
+void TreeMapWidget::contextMenuEvent( TQContextMenuEvent* e )
{
//kdDebug(90100) << "TreeMapWidget::contextMenuEvent" << endl;
- if ( receivers( SIGNAL(contextMenuRequested(TreeMapItem*, const QPoint &)) ) )
+ if ( receivers( TQT_SIGNAL(contextMenuRequested(TreeMapItem*, const TQPoint &)) ) )
e->accept();
- if ( e->reason() == QContextMenuEvent::Keyboard ) {
- QRect r = (_current) ? _current->itemRect() : _base->itemRect();
- QPoint p = QPoint(r.left() + r.width()/2, r.top() + r.height()/2);
+ if ( e->reason() == TQContextMenuEvent::Keyboard ) {
+ TQRect r = (_current) ? _current->itemRect() : _base->itemRect();
+ TQPoint p = TQPoint(r.left() + r.width()/2, r.top() + r.height()/2);
emit contextMenuRequested(_current, p);
}
else {
@@ -1809,7 +1809,7 @@ void TreeMapWidget::contextMenuEvent( QContextMenuEvent* e )
}
-void TreeMapWidget::mousePressEvent( QMouseEvent* e )
+void TreeMapWidget::mousePressEvent( TQMouseEvent* e )
{
//kdDebug(90100) << "TreeMapWidget::mousePressEvent" << endl;
@@ -1877,7 +1877,7 @@ void TreeMapWidget::mousePressEvent( QMouseEvent* e )
}
}
-void TreeMapWidget::mouseMoveEvent( QMouseEvent* e )
+void TreeMapWidget::mouseMoveEvent( TQMouseEvent* e )
{
//kdDebug(90100) << "TreeMapWidget::mouseMoveEvent" << endl;
@@ -1920,7 +1920,7 @@ void TreeMapWidget::mouseMoveEvent( QMouseEvent* e )
redraw(changed);
}
-void TreeMapWidget::mouseReleaseEvent( QMouseEvent* )
+void TreeMapWidget::mouseReleaseEvent( TQMouseEvent* )
{
//kdDebug(90100) << "TreeMapWidget::mouseReleaseEvent" << endl;
@@ -1950,7 +1950,7 @@ void TreeMapWidget::mouseReleaseEvent( QMouseEvent* )
}
-void TreeMapWidget::mouseDoubleClickEvent( QMouseEvent* e )
+void TreeMapWidget::mouseDoubleClickEvent( TQMouseEvent* e )
{
TreeMapItem* over = item(e->x(), e->y());
@@ -1969,7 +1969,7 @@ int nextVisible(TreeMapItem* i)
while (idx < (int)p->children()->count()-1) {
idx++;
- QRect r = p->children()->at(idx)->itemRect();
+ TQRect r = p->children()->at(idx)->itemRect();
if (r.width()>1 && r.height()>1)
return idx;
}
@@ -1987,7 +1987,7 @@ int prevVisible(TreeMapItem* i)
while (idx > 0) {
idx--;
- QRect r = p->children()->at(idx)->itemRect();
+ TQRect r = p->children()->at(idx)->itemRect();
if (r.width()>1 && r.height()>1)
return idx;
}
@@ -1997,7 +1997,7 @@ int prevVisible(TreeMapItem* i)
-void TreeMapWidget::keyPressEvent( QKeyEvent* e )
+void TreeMapWidget::keyPressEvent( TQKeyEvent* e )
{
if (e->key() == Key_Escape && _pressed) {
@@ -2111,24 +2111,24 @@ void TreeMapWidget::keyPressEvent( QKeyEvent* e )
}
}
-void TreeMapWidget::fontChange( const QFont& )
+void TreeMapWidget::fontChange( const TQFont& )
{
redraw();
}
-void TreeMapWidget::resizeEvent( QResizeEvent * )
+void TreeMapWidget::resizeEvent( TQResizeEvent * )
{
// this automatically redraws (as size is changed)
drawTreeMap();
}
-void TreeMapWidget::paintEvent( QPaintEvent * )
+void TreeMapWidget::paintEvent( TQPaintEvent * )
{
drawTreeMap();
}
-void TreeMapWidget::showEvent( QShowEvent * )
+void TreeMapWidget::showEvent( TQShowEvent * )
{
// refresh only if needed
drawTreeMap();
@@ -2151,14 +2151,14 @@ void TreeMapWidget::drawTreeMap()
if (_needsRefresh == _base) {
// redraw whole widget
- _pixmap = QPixmap(size());
+ _pixmap = TQPixmap(size());
_pixmap.fill(backgroundColor());
}
- QPainter p(&_pixmap);
+ TQPainter p(&_pixmap);
if (_needsRefresh == _base) {
p.setPen(black);
- p.drawRect(QRect(2, 2, QWidget::width()-4, QWidget::height()-4));
- _base->setItemRect(QRect(3, 3, QWidget::width()-6, QWidget::height()-6));
+ p.drawRect(TQRect(2, 2, TQWidget::width()-4, TQWidget::height()-4));
+ _base->setItemRect(TQRect(3, 3, TQWidget::width()-6, TQWidget::height()-6));
}
else {
// only subitem
@@ -2174,12 +2174,12 @@ void TreeMapWidget::drawTreeMap()
}
bitBlt( this, 0, 0, &_pixmap, 0, 0,
- QWidget::width(), QWidget::height(), CopyROP, true);
+ TQWidget::width(), TQWidget::height(), CopyROP, true);
if (hasFocus()) {
- QPainter p(this);
- style().drawPrimitive( QStyle::PE_FocusRect, &p,
- QRect(0, 0, QWidget::width(), QWidget::height()),
+ TQPainter p(this);
+ style().drawPrimitive( TQStyle::PE_FocusRect, &p,
+ TQRect(0, 0, TQWidget::width(), TQWidget::height()),
colorGroup() );
}
}
@@ -2203,7 +2203,7 @@ void TreeMapWidget::redraw(TreeMapItem* i)
}
}
-void TreeMapWidget::drawItem(QPainter* p,
+void TreeMapWidget::drawItem(TQPainter* p,
TreeMapItem* item)
{
bool isSelected = false;
@@ -2235,7 +2235,7 @@ void TreeMapWidget::drawItem(QPainter* p,
}
-bool TreeMapWidget::horizontal(TreeMapItem* i, const QRect& r)
+bool TreeMapWidget::horizontal(TreeMapItem* i, const TQRect& r)
{
switch(i->splitMode()) {
case TreeMapItem::HAlternate:
@@ -2256,7 +2256,7 @@ bool TreeMapWidget::horizontal(TreeMapItem* i, const QRect& r)
/**
* Draw TreeMapItems recursive, starting from item
*/
-void TreeMapWidget::drawItems(QPainter* p,
+void TreeMapWidget::drawItems(TQPainter* p,
TreeMapItem* item)
{
if (DEBUG_DRAWING)
@@ -2269,9 +2269,9 @@ void TreeMapWidget::drawItems(QPainter* p,
drawItem(p, item);
item->clearFreeRects();
- QRect origRect = item->itemRect();
+ TQRect origRect = item->itemRect();
int bw = item->borderWidth();
- QRect r = QRect(origRect.x()+bw, origRect.y()+bw,
+ TQRect r = TQRect(origRect.x()+bw, origRect.y()+bw,
origRect.width()-2*bw, origRect.height()-2*bw);
TreeMapItemList* list = item->children();
@@ -2295,7 +2295,7 @@ void TreeMapWidget::drawItems(QPainter* p,
// stop drawing if stopAtText is reached
if (!stopDrawing)
for (int no=0;no<(int)_attr.size();no++) {
- QString stopAt = fieldStop(no);
+ TQString stopAt = fieldStop(no);
if (!stopAt.isEmpty() && (item->text(no) == stopAt)) {
stopDrawing = true;
break;
@@ -2349,7 +2349,7 @@ void TreeMapWidget::drawItems(QPainter* p,
<< i->value() << endl;
}
- QRect orig = r;
+ TQRect orig = r;
// if we have space for text...
if ((r.height() >= _fontHeight) && (r.width() >= _fontHeight)) {
@@ -2366,12 +2366,12 @@ void TreeMapWidget::drawItems(QPainter* p,
if (orig.x() == r.x()) {
// Strings on top
- item->addFreeRect(QRect(orig.x(), orig.y(),
+ item->addFreeRect(TQRect(orig.x(), orig.y(),
orig.width(), orig.height()-r.height()));
}
else {
// Strings on the left
- item->addFreeRect(QRect(orig.x(), orig.y(),
+ item->addFreeRect(TQRect(orig.x(), orig.y(),
orig.width()-r.width(), orig.height()));
}
@@ -2418,7 +2418,7 @@ void TreeMapWidget::drawItems(QPainter* p,
self / user_sum + .5);
if (self_length > 0) {
// take space for self cost
- QRect sr = r;
+ TQRect sr = r;
if (rotate) {
sr.setWidth( self_length );
r.setRect(r.x()+sr.width(), r.y(), r.width()-sr.width(), r.height());
@@ -2479,7 +2479,7 @@ void TreeMapWidget::drawItems(QPainter* p,
// we always split horizontally
int nextPos = (int)((double)r.width() * valSum / user_sum);
- QRect firstRect = QRect(r.x(), r.y(), nextPos, r.height());
+ TQRect firstRect = TQRect(r.x(), r.y(), nextPos, r.height());
if (nextPos < _visibleWidth) {
if (item->sorting(0) == -1) {
@@ -2530,7 +2530,7 @@ void TreeMapWidget::drawItems(QPainter* p,
// we always split horizontally
int nextPos = (int)((double)r.height() * valSum / user_sum);
- QRect firstRect = QRect(r.x(), r.y(), r.width(), nextPos);
+ TQRect firstRect = TQRect(r.x(), r.y(), r.width(), nextPos);
if (nextPos < _visibleWidth) {
if (item->sorting(0) == -1) {
@@ -2567,7 +2567,7 @@ void TreeMapWidget::drawItems(QPainter* p,
}
// fills area with a pattern if to small to draw children
-void TreeMapWidget::drawFill(TreeMapItem* i, QPainter* p, QRect& r)
+void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r)
{
p->setBrush(Qt::Dense4Pattern);
p->setPen(Qt::NoPen);
@@ -2576,7 +2576,7 @@ void TreeMapWidget::drawFill(TreeMapItem* i, QPainter* p, QRect& r)
}
// fills area with a pattern if to small to draw children
-void TreeMapWidget::drawFill(TreeMapItem* i, QPainter* p, QRect& r,
+void TreeMapWidget::drawFill(TreeMapItem* i, TQPainter* p, TQRect& r,
TreeMapItemListIterator it, int len, bool goBack)
{
if (DEBUG_DRAWING)
@@ -2606,8 +2606,8 @@ void TreeMapWidget::drawFill(TreeMapItem* i, QPainter* p, QRect& r,
}
// returns false if rect gets to small
-bool TreeMapWidget::drawItemArray(QPainter* p, TreeMapItem* item,
- QRect& r, double user_sum,
+bool TreeMapWidget::drawItemArray(TQPainter* p, TreeMapItem* item,
+ TQRect& r, double user_sum,
TreeMapItemListIterator it, int len,
bool goBack)
{
@@ -2647,14 +2647,14 @@ bool TreeMapWidget::drawItemArray(QPainter* p, TreeMapItem* item,
if (r.width() > r.height()) {
int halfPos = (int)((double)r.width() * valSum / user_sum);
- QRect firstRect = QRect(r.x(), r.y(), halfPos, r.height());
+ TQRect firstRect = TQRect(r.x(), r.y(), halfPos, r.height());
drawOn = drawItemArray(p, item, firstRect,
valSum, first, len-lenLeft, goBack);
r.setRect(r.x()+halfPos, r.y(), r.width()-halfPos, r.height());
}
else {
int halfPos = (int)((double)r.height() * valSum / user_sum);
- QRect firstRect = QRect(r.x(), r.y(), r.width(), halfPos);
+ TQRect firstRect = TQRect(r.x(), r.y(), r.width(), halfPos);
drawOn = drawItemArray(p, item, firstRect,
valSum, first, len-lenLeft, goBack);
r.setRect(r.x(), r.y()+halfPos, r.width(), r.height()-halfPos);
@@ -2723,7 +2723,7 @@ bool TreeMapWidget::drawItemArray(QPainter* p, TreeMapItem* item,
return false;
}
- QRect currRect = r;
+ TQRect currRect = r;
if (hor)
currRect.setWidth(nextPos);
@@ -2798,13 +2798,13 @@ void TreeMapWidget::splitActivated(int id)
}
-void TreeMapWidget::addSplitDirectionItems(QPopupMenu* popup, int id)
+void TreeMapWidget::addSplitDirectionItems(TQPopupMenu* popup, int id)
{
_splitID = id;
popup->setCheckable(true);
- connect(popup, SIGNAL(activated(int)),
- this, SLOT(splitActivated(int)));
+ connect(popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(splitActivated(int)));
popup->insertItem(i18n("Recursive Bisection"), id);
popup->insertItem(i18n("Columns"), id+1);
@@ -2853,21 +2853,21 @@ void TreeMapWidget::visualizationActivated(int id)
else if ((id%10) == 8) setFieldPosition(f, DrawParams::BottomRight);
}
-void TreeMapWidget::addVisualizationItems(QPopupMenu* popup, int id)
+void TreeMapWidget::addVisualizationItems(TQPopupMenu* popup, int id)
{
_visID = id;
popup->setCheckable(true);
- QPopupMenu* bpopup = new QPopupMenu();
+ TQPopupMenu* bpopup = new TQPopupMenu();
bpopup->setCheckable(true);
- connect(popup, SIGNAL(activated(int)),
- this, SLOT(visualizationActivated(int)));
- connect(bpopup, SIGNAL(activated(int)),
- this, SLOT(visualizationActivated(int)));
+ connect(popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(visualizationActivated(int)));
+ connect(bpopup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(visualizationActivated(int)));
- QPopupMenu* spopup = new QPopupMenu();
+ TQPopupMenu* spopup = new TQPopupMenu();
addSplitDirectionItems(spopup, id+100);
popup->insertItem(i18n("Nesting"), spopup, id);
@@ -2893,10 +2893,10 @@ void TreeMapWidget::addVisualizationItems(QPopupMenu* popup, int id)
popup->insertSeparator();
int f;
- QPopupMenu* tpopup;
+ TQPopupMenu* tpopup;
id += 20;
for (f=0;f<(int)_attr.size();f++, id+=10) {
- tpopup = new QPopupMenu();
+ tpopup = new TQPopupMenu();
tpopup->setCheckable(true);
popup->insertItem(_attr[f].type, tpopup, id);
tpopup->insertItem(i18n("Visible"), id+1);
@@ -2925,8 +2925,8 @@ void TreeMapWidget::addVisualizationItems(QPopupMenu* popup, int id)
tpopup->setItemChecked(id+7,_attr[f].pos == DrawParams::BottomCenter);
tpopup->setItemChecked(id+8,_attr[f].pos == DrawParams::BottomRight);
- connect(tpopup, SIGNAL(activated(int)),
- this, SLOT(visualizationActivated(int)));
+ connect(tpopup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(visualizationActivated(int)));
}
}
@@ -2942,7 +2942,7 @@ void TreeMapWidget::selectionActivated(int id)
setSelected(i, true);
}
-void TreeMapWidget::addSelectionItems(QPopupMenu* popup,
+void TreeMapWidget::addSelectionItems(TQPopupMenu* popup,
int id, TreeMapItem* i)
{
if (!i) return;
@@ -2950,11 +2950,11 @@ void TreeMapWidget::addSelectionItems(QPopupMenu* popup,
_selectionID = id;
_menuItem = i;
- connect(popup, SIGNAL(activated(int)),
- this, SLOT(selectionActivated(int)));
+ connect(popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(selectionActivated(int)));
while (i) {
- QString name = i->text(0);
+ TQString name = i->text(0);
if (name.isEmpty()) break;
popup->insertItem(i->text(0), id++);
i = i->parent();
@@ -2963,7 +2963,7 @@ void TreeMapWidget::addSelectionItems(QPopupMenu* popup,
void TreeMapWidget::fieldStopActivated(int id)
{
- if (id == _fieldStopID) setFieldStop(0, QString::null);
+ if (id == _fieldStopID) setFieldStop(0, TQString::null);
else {
TreeMapItem* i = _menuItem;
id -= _fieldStopID+1;
@@ -2976,13 +2976,13 @@ void TreeMapWidget::fieldStopActivated(int id)
}
}
-void TreeMapWidget::addFieldStopItems(QPopupMenu* popup,
+void TreeMapWidget::addFieldStopItems(TQPopupMenu* popup,
int id, TreeMapItem* i)
{
_fieldStopID = id;
- connect(popup, SIGNAL(activated(int)),
- this, SLOT(fieldStopActivated(int)));
+ connect(popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(fieldStopActivated(int)));
popup->insertItem(i18n("No %1 Limit").arg(fieldType(0)), id);
popup->setItemChecked(id, fieldStop(0).isEmpty());
@@ -2993,7 +2993,7 @@ void TreeMapWidget::addFieldStopItems(QPopupMenu* popup,
while (i) {
id++;
- QString name = i->text(0);
+ TQString name = i->text(0);
if (name.isEmpty()) break;
popup->insertItem(i->text(0), id);
if (fieldStop(0) == i->text(0)) {
@@ -3025,14 +3025,14 @@ void TreeMapWidget::areaStopActivated(int id)
else if (id == _areaStopID+6) setMinimalArea(minimalArea()/2);
}
-void TreeMapWidget::addAreaStopItems(QPopupMenu* popup,
+void TreeMapWidget::addAreaStopItems(TQPopupMenu* popup,
int id, TreeMapItem* i)
{
_areaStopID = id;
_menuItem = i;
- connect(popup, SIGNAL(activated(int)),
- this, SLOT(areaStopActivated(int)));
+ connect(popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(areaStopActivated(int)));
bool foundArea = false;
@@ -3087,14 +3087,14 @@ void TreeMapWidget::depthStopActivated(int id)
else if (id == _depthStopID+3) setMaxDrawingDepth(maxDrawingDepth()+1);
}
-void TreeMapWidget::addDepthStopItems(QPopupMenu* popup,
+void TreeMapWidget::addDepthStopItems(TQPopupMenu* popup,
int id, TreeMapItem* i)
{
_depthStopID = id;
_menuItem = i;
- connect(popup, SIGNAL(activated(int)),
- this, SLOT(depthStopActivated(int)));
+ connect(popup, TQT_SIGNAL(activated(int)),
+ this, TQT_SLOT(depthStopActivated(int)));
bool foundDepth = false;
@@ -3132,7 +3132,7 @@ void TreeMapWidget::addDepthStopItems(QPopupMenu* popup,
* Option saving/restoring
*/
-void TreeMapWidget::saveOptions(KConfigGroup* config, QString prefix)
+void TreeMapWidget::saveOptions(KConfigGroup* config, TQString prefix)
{
config->writeEntry(prefix+"Nesting", splitModeString());
config->writeEntry(prefix+"AllowRotation", allowRotation());
@@ -3145,23 +3145,23 @@ void TreeMapWidget::saveOptions(KConfigGroup* config, QString prefix)
int f, fCount = _attr.size();
config->writeEntry(prefix+"FieldCount", fCount);
for (f=0;f<fCount;f++) {
- config->writeEntry(QString(prefix+"FieldVisible%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldVisible%1").arg(f),
_attr[f].visible);
- config->writeEntry(QString(prefix+"FieldForced%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldForced%1").arg(f),
_attr[f].forced);
- config->writeEntry(QString(prefix+"FieldStop%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldStop%1").arg(f),
_attr[f].stop);
- config->writeEntry(QString(prefix+"FieldPosition%1").arg(f),
+ config->writeEntry(TQString(prefix+"FieldPosition%1").arg(f),
fieldPositionString(f));
}
}
-void TreeMapWidget::restoreOptions(KConfigGroup* config, QString prefix)
+void TreeMapWidget::restoreOptions(KConfigGroup* config, TQString prefix)
{
bool enabled;
int num;
- QString str;
+ TQString str;
str = config->readEntry(prefix+"Nesting");
if (!str.isEmpty()) setSplitMode(str);
@@ -3195,18 +3195,18 @@ void TreeMapWidget::restoreOptions(KConfigGroup* config, QString prefix)
int f;
for (f=0;f<num;f++) {
- str = QString(prefix+"FieldVisible%1").arg(f);
+ str = TQString(prefix+"FieldVisible%1").arg(f);
if (config->hasKey(str))
setFieldVisible(f, config->readBoolEntry(str));
- str = QString(prefix+"FieldForced%1").arg(f);
+ str = TQString(prefix+"FieldForced%1").arg(f);
if (config->hasKey(str))
setFieldForced(f, config->readBoolEntry(str));
- str = config->readEntry(QString(prefix+"FieldStop%1").arg(f));
+ str = config->readEntry(TQString(prefix+"FieldStop%1").arg(f));
setFieldStop(f, str);
- str = config->readEntry(QString(prefix+"FieldPosition%1").arg(f));
+ str = config->readEntry(TQString(prefix+"FieldPosition%1").arg(f));
if (!str.isEmpty()) setFieldPosition(f, str);
}
}