diff options
Diffstat (limited to 'kcachegrind/kcachegrind/listutils.cpp')
-rw-r--r-- | kcachegrind/kcachegrind/listutils.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/kcachegrind/kcachegrind/listutils.cpp b/kcachegrind/kcachegrind/listutils.cpp index 0e9ebd32..5c4a838c 100644 --- a/kcachegrind/kcachegrind/listutils.cpp +++ b/kcachegrind/kcachegrind/listutils.cpp @@ -17,18 +17,18 @@ */ /* - * Some helper functions for QListViewItem derivates + * Some helper functions for TQListViewItem derivates */ -#include <qpainter.h> +#include <tqpainter.h> #include "listutils.h" #define COSTPIX_WIDTH 25 -QPixmap colorPixmap(int w, int h, QColor c) +TQPixmap colorPixmap(int w, int h, TQColor c) { - static QPixmap* pixs[37]; - static QColor cols[37]; + static TQPixmap* pixs[37]; + static TQColor cols[37]; static bool inited = false; if (!inited) { @@ -46,9 +46,9 @@ QPixmap colorPixmap(int w, int h, QColor c) } - QPixmap* pix = new QPixmap(w, h); + TQPixmap* pix = new TQPixmap(w, h); pix->fill(c); - QPainter p(pix); + TQPainter p(pix); p.setPen(c.light()); p.drawLine(0, 0, w-1, 0); p.drawLine(0, 0, 0, h-1); @@ -65,7 +65,7 @@ QPixmap colorPixmap(int w, int h, QColor c) * Create a percentage pixmap with a filling rate of p percent (0-100). * When withFrame==false, the pixmap is truncated to only the filled portion. */ -QPixmap percentagePixmap(int w, int h, int percent, QColor c, bool framed) +TQPixmap percentagePixmap(int w, int h, int percent, TQColor c, bool framed) { int iw, ix1, ix2, ih, iy1, iy2; @@ -82,11 +82,11 @@ QPixmap percentagePixmap(int w, int h, int percent, QColor c, bool framed) /* Limit bar to 100% */ int filled = (percent>100) ? iw+1 : iw*percent/100+1; if (!framed) w=filled-1; - if (w<3) return QPixmap(); + if (w<3) return TQPixmap(); - QPixmap pix(w, h); + TQPixmap pix(w, h); pix.fill(Qt::white); - QPainter p(&pix); + TQPainter p(&pix); p.setPen(Qt::black); if (framed) p.drawRect(0, 0, w, h); @@ -108,15 +108,15 @@ QPixmap percentagePixmap(int w, int h, int percent, QColor c, bool framed) return pix; } -inline QColor partitionColor(int d, int max) +inline TQColor partitionColor(int d, int max) { - return QColor( (720*d/max) % 360, - 255-(128*d/max), 192, QColor::Hsv); + return TQColor( (720*d/max) % 360, + 255-(128*d/max), 192, TQColor::Hsv); } -QPixmap partitionPixmap(int w, int h, - double* hist, QColor* cArray, int maxIndex, bool framed) +TQPixmap partitionPixmap(int w, int h, + double* hist, TQColor* cArray, int maxIndex, bool framed) { int lastPos = 0, nextPos; double val=0.0, sum=0.0; @@ -141,18 +141,18 @@ QPixmap partitionPixmap(int w, int h, int filled = (int)(iw*sum+1); if (!framed && (filled < w)) w=filled; - if (w<3) return QPixmap(); + if (w<3) return TQPixmap(); - QPixmap pix(w, h); + TQPixmap pix(w, h); pix.fill(Qt::white); - QPainter p(&pix); + TQPainter p(&pix); p.setPen(Qt::black); if (framed) p.drawRect(0, 0, w, h); //qDebug("Sum %f, dw %d", sum,dw); - QColor c, cLast; + TQColor c, cLast; bool leftDrawn = false; int x1, x2=0; int lastDiff=0, diff; @@ -205,20 +205,20 @@ QPixmap partitionPixmap(int w, int h, } -QPixmap costPixmap(TraceCostType* ct, TraceCost* cost, double total, bool framed) +TQPixmap costPixmap(TraceCostType* ct, TraceCost* cost, double total, bool framed) { if (ct->isReal()) { - QColor color = ct->color(); + TQColor color = ct->color(); double p = 100.0 * cost->subCost(ct) / total; return percentagePixmap(COSTPIX_WIDTH, 10, (int)(p+.5), color, framed); } int maxIndex; double h[MaxRealIndexValue]; - QColor* cs = ct->mapping()->realColors(); + TQColor* cs = ct->mapping()->realColors(); maxIndex = ct->histCost(cost, total, h); - if (maxIndex ==0) return QPixmap(); + if (maxIndex ==0) return TQPixmap(); return partitionPixmap(COSTPIX_WIDTH, 10, h, cs, maxIndex, framed); } |