From 7346aee26bf190a7e70333c40fab4caca847cd27 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:22:56 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1157634 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- konq-plugins/fsview/treemap.h | 178 +++++++++++++++++++++--------------------- 1 file changed, 89 insertions(+), 89 deletions(-) (limited to 'konq-plugins/fsview/treemap.h') diff --git a/konq-plugins/fsview/treemap.h b/konq-plugins/fsview/treemap.h index a834d23..1deee35 100644 --- a/konq-plugins/fsview/treemap.h +++ b/konq-plugins/fsview/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 -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include 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; } @@ -98,39 +98,39 @@ 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; } - 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; } void setRotated(bool b) { _rotated = b; } protected: - QColor _backColor; + TQColor _backColor; bool _selected, _current, _shaded, _rotated; private: @@ -138,13 +138,13 @@ private: void ensureField(int f); struct Field { - QString text; - QPixmap pix; + TQString text; + TQPixmap pix; Position pos; int maxLines; }; - QValueVector _field; + TQValueVector _field; }; @@ -160,7 +160,7 @@ private: class RectDrawing { public: - RectDrawing(QRect); + RectDrawing(TQRect); ~RectDrawing(); // The default DrawParams object used. @@ -168,33 +168,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 +class TreeMapItemList: public TQPtrList { public: TreeMapItem* commonParent(); @@ -202,7 +202,7 @@ protected: int compareItems ( Item item1, Item item2 ); }; -typedef QPtrListIterator TreeMapItemListIterator; +typedef TQPtrListIterator TreeMapItemListIterator; /** @@ -239,8 +239,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*); @@ -272,7 +272,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. @@ -288,9 +288,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(); } @@ -299,8 +299,8 @@ public: * Used internally to enable tooltip. */ void clearFreeRects(); - QPtrList* freeRects() const { return _freeRects; } - void addFreeRect(const QRect& r); + TQPtrList* freeRects() const { return _freeRects; } + void addFreeRect(const TQRect& r); /** * Temporary child item index of the child that was current() recently. @@ -323,7 +323,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; @@ -373,8 +373,8 @@ private: bool _sortAscending; // temporary layout - QRect _rect; - QPtrList* _freeRects; + TQRect _rect; + TQPtrList* _freeRects; int _depth; // temporary self value (when using level skipping) @@ -400,7 +400,7 @@ public: */ enum SelectionMode { Single, Multi, Extended, NoSelection }; - TreeMapWidget(TreeMapItem* base, QWidget* parent=0, const char* name=0); + TreeMapWidget(TreeMapItem* base, TQWidget* parent=0, const char* name=0); ~TreeMapWidget(); /** @@ -411,7 +411,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 @@ -493,8 +493,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; /* @@ -542,8 +542,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; @@ -553,14 +553,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? @@ -583,8 +583,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? @@ -598,8 +598,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. @@ -607,12 +607,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; } @@ -625,7 +625,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. @@ -666,20 +666,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&); @@ -689,13 +689,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); @@ -706,11 +706,11 @@ private: // attributes for field, per textNo struct FieldAttr { - QString type, stop; + TQString type, stop; bool visible, forced; DrawParams::Position pos; }; - QValueVector _attr; + TQValueVector _attr; SelectionMode _selectionMode; TreeMapItem::SplitMode _splitMode; @@ -732,11 +732,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 -- cgit v1.2.1