summaryrefslogtreecommitdiffstats
path: root/kcachegrind/kcachegrind/treemap.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
commit4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch)
treeb0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kcachegrind/kcachegrind/treemap.h
parent1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff)
downloadtdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz
tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcachegrind/kcachegrind/treemap.h')
-rw-r--r--kcachegrind/kcachegrind/treemap.h178
1 files changed, 89 insertions, 89 deletions
diff --git a/kcachegrind/kcachegrind/treemap.h b/kcachegrind/kcachegrind/treemap.h
index 4bb0b4cd..5508d8fd 100644
--- a/kcachegrind/kcachegrind/treemap.h
+++ b/kcachegrind/kcachegrind/treemap.h
@@ -18,7 +18,7 @@
/**
* A Widget for visualizing hierarchical metrics as areas.
- * The API is similar to QListView.
+ * The API is similar to TQListView.
*
* This file defines the following classes:
* DrawParams, RectDrawing, TreeMapItem, TreeMapWidget
@@ -30,14 +30,14 @@
#ifndef TREEMAP_H
#define TREEMAP_H
-#include <qstring.h>
-#include <qwidget.h>
-#include <qpixmap.h>
-#include <qptrlist.h>
-#include <qvaluevector.h>
-#include <qcolor.h>
-#include <qapplication.h>
-#include <qstringlist.h>
+#include <tqstring.h>
+#include <tqwidget.h>
+#include <tqpixmap.h>
+#include <tqptrlist.h>
+#include <tqvaluevector.h>
+#include <tqcolor.h>
+#include <tqapplication.h>
+#include <tqstringlist.h>
class QPopupMenu;
class TreeMapTip;
@@ -74,15 +74,15 @@ public:
// no constructor as this is an abstract class
virtual ~DrawParams() {}
- virtual QString text(int) const = 0;
- virtual QPixmap pixmap(int) const = 0;
+ virtual TQString text(int) const = 0;
+ virtual TQPixmap pixmap(int) const = 0;
virtual Position position(int) const = 0;
// 0: no limit, negative: leave at least -maxLines() free
virtual int maxLines(int) const { return 0; }
virtual int fieldCount() const { return 0; }
- virtual QColor backColor() const { return Qt::white; }
- virtual const QFont& font() const = 0;
+ virtual TQColor backColor() const { return Qt::white; }
+ virtual const TQFont& font() const = 0;
virtual bool selected() const { return false; }
virtual bool current() const { return false; }
@@ -99,33 +99,33 @@ class StoredDrawParams: public DrawParams
{
public:
StoredDrawParams();
- StoredDrawParams(QColor c,
+ StoredDrawParams(TQColor c,
bool selected = false, bool current = false);
// getters
- QString text(int) const;
- QPixmap pixmap(int) const;
+ TQString text(int) const;
+ TQPixmap pixmap(int) const;
Position position(int) const;
int maxLines(int) const;
int fieldCount() const { return _field.size(); }
- QColor backColor() const { return _backColor; }
+ TQColor backColor() const { return _backColor; }
bool selected() const { return _selected; }
bool current() const { return _current; }
bool shaded() const { return _shaded; }
bool rotated() const { return _rotated; }
bool drawFrame() const { return _drawFrame; }
- const QFont& font() const;
+ const TQFont& font() const;
// attribute setters
- void setField(int f, const QString& t, QPixmap pm = QPixmap(),
+ void setField(int f, const TQString& t, TQPixmap pm = TQPixmap(),
Position p = Default, int maxLines = 0);
- void setText(int f, const QString&);
- void setPixmap(int f, const QPixmap&);
+ void setText(int f, const TQString&);
+ void setPixmap(int f, const TQPixmap&);
void setPosition(int f, Position);
void setMaxLines(int f, int);
- void setBackColor(const QColor& c) { _backColor = c; }
+ void setBackColor(const TQColor& c) { _backColor = c; }
void setSelected(bool b) { _selected = b; }
void setCurrent(bool b) { _current = b; }
void setShaded(bool b) { _shaded = b; }
@@ -133,7 +133,7 @@ public:
void drawFrame(bool b) { _drawFrame = b; }
protected:
- QColor _backColor;
+ TQColor _backColor;
bool _selected :1;
bool _current :1;
bool _shaded :1;
@@ -145,13 +145,13 @@ private:
void ensureField(int f);
struct Field {
- QString text;
- QPixmap pix;
+ TQString text;
+ TQPixmap pix;
Position pos;
int maxLines;
};
- QValueVector<Field> _field;
+ TQValueVector<Field> _field;
};
@@ -167,7 +167,7 @@ private:
class RectDrawing
{
public:
- RectDrawing(QRect);
+ RectDrawing(TQRect);
~RectDrawing();
// The default DrawParams object used.
@@ -175,33 +175,33 @@ public:
// we take control over the given object (i.e. delete at destruction)
void setDrawParams(DrawParams*);
- // draw on a given QPainter, use this class as info provider per default
- void drawBack(QPainter*, DrawParams* dp = 0);
+ // draw on a given TQPainter, use this class as info provider per default
+ void drawBack(TQPainter*, DrawParams* dp = 0);
/* Draw field at position() from pixmap()/text() with maxLines().
* Returns true if something was drawn
*/
- bool drawField(QPainter*, int f, DrawParams* dp = 0);
+ bool drawField(TQPainter*, int f, DrawParams* dp = 0);
// resets rectangle for free space
- void setRect(QRect);
+ void setRect(TQRect);
// Returns the rectangle area still free of text/pixmaps after
// a number of drawText() calls.
- QRect remainingRect(DrawParams* dp = 0);
+ TQRect remainingRect(DrawParams* dp = 0);
private:
int _usedTopLeft, _usedTopCenter, _usedTopRight;
int _usedBottomLeft, _usedBottomCenter, _usedBottomRight;
- QRect _rect;
+ TQRect _rect;
// temporary
int _fontHeight;
- QFontMetrics* _fm;
+ TQFontMetrics* _fm;
DrawParams* _dp;
};
-class TreeMapItemList: public QPtrList<TreeMapItem>
+class TreeMapItemList: public TQPtrList<TreeMapItem>
{
public:
TreeMapItem* commonParent();
@@ -209,7 +209,7 @@ protected:
int compareItems ( Item item1, Item item2 );
};
-typedef QPtrListIterator<TreeMapItem> TreeMapItemListIterator;
+typedef TQPtrListIterator<TreeMapItem> TreeMapItemListIterator;
/**
@@ -246,8 +246,8 @@ public:
TreeMapItem(TreeMapItem* parent = 0, double value = 1.0 );
TreeMapItem(TreeMapItem* parent, double value,
- QString text1, QString text2 = QString::null,
- QString text3 = QString::null, QString text4 = QString::null);
+ TQString text1, TQString text2 = TQString::null,
+ TQString text3 = TQString::null, TQString text4 = TQString::null);
virtual ~TreeMapItem();
bool isChildOf(TreeMapItem*);
@@ -279,7 +279,7 @@ public:
* Returns a list of text strings of specified text number,
* from root up to this item.
*/
- QStringList path(int) const;
+ TQStringList path(int) const;
/**
* Depth of this item. This is the distance to root.
@@ -295,9 +295,9 @@ public:
* Temporary rectangle used for drawing this item the last time.
* This is internally used to map from a point to an item.
*/
- void setItemRect(const QRect& r) { _rect = r; }
+ void setItemRect(const TQRect& r) { _rect = r; }
void clearItemRect();
- const QRect& itemRect() const { return _rect; }
+ const TQRect& itemRect() const { return _rect; }
int width() const { return _rect.width(); }
int height() const { return _rect.height(); }
@@ -306,8 +306,8 @@ public:
* Used internally to enable tooltip.
*/
void clearFreeRects();
- QPtrList<QRect>* freeRects() const { return _freeRects; }
- void addFreeRect(const QRect& r);
+ TQPtrList<TQRect>* freeRects() const { return _freeRects; }
+ void addFreeRect(const TQRect& r);
/**
* Temporary child item index of the child that was current() recently.
@@ -330,7 +330,7 @@ public:
virtual double value() const;
// replace "Default" position with setting from TreeMapWidget
virtual Position position(int) const;
- virtual const QFont& font() const;
+ virtual const TQFont& font() const;
virtual bool isMarked(int) const;
virtual int borderWidth() const;
@@ -380,8 +380,8 @@ private:
bool _sortAscending;
// temporary layout
- QRect _rect;
- QPtrList<QRect>* _freeRects;
+ TQRect _rect;
+ TQPtrList<TQRect>* _freeRects;
int _depth;
// temporary self value (when using level skipping)
@@ -408,7 +408,7 @@ public:
enum SelectionMode { Single, Multi, Extended, NoSelection };
/* The widget becomes owner of the base item */
- TreeMapWidget(TreeMapItem* base, QWidget* parent=0, const char* name=0);
+ TreeMapWidget(TreeMapItem* base, TQWidget* parent=0, const char* name=0);
~TreeMapWidget();
/**
@@ -419,7 +419,7 @@ public:
/**
* Returns a reference to the current widget font.
*/
- const QFont& currentFont() const;
+ const TQFont& currentFont() const;
/**
* Returns the area item at position x/y, independent from any
@@ -501,8 +501,8 @@ public:
void setSplitMode(TreeMapItem::SplitMode m);
TreeMapItem::SplitMode splitMode() const;
// returns true if string was recognized
- bool setSplitMode(QString);
- QString splitModeString() const;
+ bool setSplitMode(TQString);
+ TQString splitModeString() const;
/*
@@ -557,8 +557,8 @@ public:
int minimalArea() const { return _minimalArea; }
/* defaults for text attributes */
- QString defaultFieldType(int) const;
- QString defaultFieldStop(int) const;
+ TQString defaultFieldType(int) const;
+ TQString defaultFieldStop(int) const;
bool defaultFieldVisible(int) const;
bool defaultFieldForced(int) const;
DrawParams::Position defaultFieldPosition(int) const;
@@ -568,14 +568,14 @@ public:
* This is important for the visualization menu generated
* with visualizationMenu()
*/
- void setFieldType(int, QString);
- QString fieldType(int) const;
+ void setFieldType(int, TQString);
+ TQString fieldType(int) const;
/**
* Stop drawing at item with name
*/
- void setFieldStop(int, QString);
- QString fieldStop(int) const;
+ void setFieldStop(int, TQString);
+ TQString fieldStop(int) const;
/**
* Should the text with number textNo be visible?
@@ -598,8 +598,8 @@ public:
*/
void setFieldPosition(int, DrawParams::Position);
DrawParams::Position fieldPosition(int) const;
- void setFieldPosition(int, QString);
- QString fieldPositionString(int) const;
+ void setFieldPosition(int, TQString);
+ TQString fieldPositionString(int) const;
/**
* Do we allow the texts to be rotated by 90 degrees for better fitting?
@@ -613,8 +613,8 @@ public:
/**
* Save/restore options.
*/
- void saveOptions(KConfigGroup*, QString prefix = QString::null);
- void restoreOptions(KConfigGroup*, QString prefix = QString::null);
+ void saveOptions(KConfigGroup*, TQString prefix = TQString::null);
+ void restoreOptions(KConfigGroup*, TQString prefix = TQString::null);
/**
* These functions populate given popup menus.
@@ -622,12 +622,12 @@ public:
*
* The int is the menu id where to start for the items (100 IDs reserved).
*/
- void addSplitDirectionItems(QPopupMenu*, int);
- void addSelectionItems(QPopupMenu*, int, TreeMapItem*);
- void addFieldStopItems(QPopupMenu*, int, TreeMapItem*);
- void addAreaStopItems(QPopupMenu*, int, TreeMapItem*);
- void addDepthStopItems(QPopupMenu*, int, TreeMapItem*);
- void addVisualizationItems(QPopupMenu*, int);
+ void addSplitDirectionItems(TQPopupMenu*, int);
+ void addSelectionItems(TQPopupMenu*, int, TreeMapItem*);
+ void addFieldStopItems(TQPopupMenu*, int, TreeMapItem*);
+ void addAreaStopItems(TQPopupMenu*, int, TreeMapItem*);
+ void addDepthStopItems(TQPopupMenu*, int, TreeMapItem*);
+ void addVisualizationItems(TQPopupMenu*, int);
TreeMapWidget* widget() { return this; }
TreeMapItem* current() const { return _current; }
@@ -640,7 +640,7 @@ public:
* Return tooltip string to show for a item (can be rich text)
* Default implementation gives lines with "text0 (text1)" going to root.
*/
- virtual QString tipString(TreeMapItem* i) const;
+ virtual TQString tipString(TreeMapItem* i) const;
/**
* Redraws an item with all children.
@@ -681,20 +681,20 @@ signals:
void clicked(TreeMapItem*);
void returnPressed(TreeMapItem*);
void doubleClicked(TreeMapItem*);
- void rightButtonPressed(TreeMapItem*, const QPoint &);
- void contextMenuRequested(TreeMapItem*, const QPoint &);
+ void rightButtonPressed(TreeMapItem*, const TQPoint &);
+ void contextMenuRequested(TreeMapItem*, const TQPoint &);
protected:
- void mousePressEvent( QMouseEvent * );
- void contextMenuEvent( QContextMenuEvent * );
- void mouseReleaseEvent( QMouseEvent * );
- void mouseMoveEvent( QMouseEvent * );
- void mouseDoubleClickEvent( QMouseEvent * );
- void keyPressEvent( QKeyEvent* );
- void paintEvent( QPaintEvent * );
- void resizeEvent( QResizeEvent * );
- void showEvent( QShowEvent * );
- void fontChange( const QFont& );
+ void mousePressEvent( TQMouseEvent * );
+ void contextMenuEvent( TQContextMenuEvent * );
+ void mouseReleaseEvent( TQMouseEvent * );
+ void mouseMoveEvent( TQMouseEvent * );
+ void mouseDoubleClickEvent( TQMouseEvent * );
+ void keyPressEvent( TQKeyEvent* );
+ void paintEvent( TQPaintEvent * );
+ void resizeEvent( TQResizeEvent * );
+ void showEvent( TQShowEvent * );
+ void fontChange( const TQFont& );
private:
TreeMapItemList diff(TreeMapItemList&, TreeMapItemList&);
@@ -704,13 +704,13 @@ private:
TreeMapItem* i2, bool selected);
bool isTmpSelected(TreeMapItem* i);
- void drawItem(QPainter* p, TreeMapItem*);
- void drawItems(QPainter* p, TreeMapItem*);
- bool horizontal(TreeMapItem* i, const QRect& r);
- void drawFill(TreeMapItem*,QPainter* p, QRect& r);
- void drawFill(TreeMapItem*,QPainter* p, QRect& r,
+ void drawItem(TQPainter* p, TreeMapItem*);
+ void drawItems(TQPainter* p, TreeMapItem*);
+ bool horizontal(TreeMapItem* i, const TQRect& r);
+ void drawFill(TreeMapItem*,TQPainter* p, TQRect& r);
+ void drawFill(TreeMapItem*,TQPainter* p, TQRect& r,
TreeMapItemListIterator it, int len, bool goBack);
- bool drawItemArray(QPainter* p, TreeMapItem*, QRect& r, double,
+ bool drawItemArray(TQPainter* p, TreeMapItem*, TQRect& r, double,
TreeMapItemListIterator it, int len, bool);
bool resizeAttr(int);
@@ -721,11 +721,11 @@ private:
// attributes for field, per textNo
struct FieldAttr {
- QString type, stop;
+ TQString type, stop;
bool visible, forced;
DrawParams::Position pos;
};
- QValueVector<FieldAttr> _attr;
+ TQValueVector<FieldAttr> _attr;
SelectionMode _selectionMode;
TreeMapItem::SplitMode _splitMode;
@@ -748,11 +748,11 @@ private:
bool _inShiftDrag, _inControlDrag;
// temporary widget font metrics while drawing
- QFont _font;
+ TQFont _font;
int _fontHeight;
// back buffer pixmap
- QPixmap _pixmap;
+ TQPixmap _pixmap;
};
#endif