diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-18 17:00:31 +0000 |
commit | 395a904bff7b4d6ead445c342f7ac0c5fbf29121 (patch) | |
tree | 9829cadb79d2cc7c29a940627fadb28b11e54150 /konq-plugins/fsview/treemap.h | |
parent | 399f47c376fdf4d19192732a701ea9578d11619d (diff) | |
download | tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.tar.gz tdeaddons-395a904bff7b4d6ead445c342f7ac0c5fbf29121.zip |
TQt4 port kdeaddons
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1237404 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'konq-plugins/fsview/treemap.h')
-rw-r--r-- | konq-plugins/fsview/treemap.h | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/konq-plugins/fsview/treemap.h b/konq-plugins/fsview/treemap.h index d4b37a9..ca10251 100644 --- a/konq-plugins/fsview/treemap.h +++ b/konq-plugins/fsview/treemap.h @@ -81,7 +81,7 @@ public: virtual int maxLines(int) const { return 0; } virtual int fieldCount() const { return 0; } - virtual TQColor backColor() const { return Qt::white; } + virtual TQColor backColor() const { return TQt::white; } virtual const TQFont& font() const = 0; virtual bool selected() const { return false; } @@ -215,7 +215,7 @@ typedef TQPtrListIterator<TreeMapItem> TreeMapItemListIterator; * * If you want more flexibility, reimplement TreeMapItem and * override the corresponding methods. For dynamic creation of child - * items on demand, reimplement children(). + * items on demand, reimplement tqchildren(). */ class TreeMapItem: public StoredDrawParams { @@ -227,20 +227,20 @@ public: * longest side of rectangle left for drawing * Best: Choose split direction for all subitems of an area * depending on longest side - * HAlternate: Horizontal at top; alternate direction on depth step - * VAlternate: Vertical at top; alternate direction on depth step - * Horizontal: Always horizontal split direction - * Vertical: Always vertical split direction + * HAlternate:Qt::Horizontal at top; alternate direction on depth step + * VAlternate:Qt::Vertical at top; alternate direction on depth step + * Qt::Horizontal: Always horizontal split direction + * Qt::Vertical: Always vertical split direction */ enum SplitMode { Bisection, Columns, Rows, AlwaysBest, Best, HAlternate, VAlternate, Horizontal, Vertical }; - TreeMapItem(TreeMapItem* parent = 0, double value = 1.0 ); - TreeMapItem(TreeMapItem* parent, double value, - TQString text1, TQString text2 = TQString::null, - TQString text3 = TQString::null, TQString text4 = TQString::null); + TreeMapItem(TreeMapItem* tqparent = 0, double value = 1.0 ); + TreeMapItem(TreeMapItem* tqparent, double value, + TQString text1, TQString text2 = TQString(), + TQString text3 = TQString(), TQString text4 = TQString()); virtual ~TreeMapItem(); bool isChildOf(TreeMapItem*); @@ -250,7 +250,7 @@ public: // force a redraw of this item void redraw(); - // delete all children + // delete all tqchildren void clear(); // force new child generation & refresh @@ -261,9 +261,9 @@ public: bool initialized(); /** - * Adds an item to a parent. + * Adds an item to a tqparent. * When no sorting is used, the item is appended (drawn at bottom). - * This is only needed if the parent was not already specified in the + * This is only needed if the tqparent was not already specified in the * construction of the item. */ void addItem(TreeMapItem*); @@ -282,7 +282,7 @@ public: /** * Parent Item */ - TreeMapItem* parent() const { return _parent; } + TreeMapItem* tqparent() const { return _parent; } /** * Temporary rectangle used for drawing this item the last time. @@ -290,7 +290,7 @@ public: */ void setItemRect(const TQRect& r) { _rect = r; } void clearItemRect(); - const TQRect& itemRect() const { return _rect; } + const TQRect& tqitemRect() const { return _rect; } int width() const { return _rect.width(); } int height() const { return _rect.height(); } @@ -321,7 +321,7 @@ public: virtual double sum() const; virtual double value() const; - // replace "Default" position with setting from TreeMapWidget + // tqreplace "Default" position with setting from TreeMapWidget virtual Position position(int) const; virtual const TQFont& font() const; virtual bool isMarked(int) const; @@ -343,7 +343,7 @@ public: * For value() sorting, use <textNo> = -2 * * For fast sorting, set this to -1 before child insertions and call - * again after inserting all children. + * again after inserting all tqchildren. */ void setSorting(int textNo, bool ascending = true); @@ -351,18 +351,18 @@ public: * Resort according to the already set sorting. * * This has to be done if the sorting base changes (e.g. text or values - * change). If this is only true for the children of this item, you can + * change). If this is only true for the tqchildren of this item, you can * set the recursive parameter to false. */ void resort(bool recursive = true); virtual SplitMode splitMode() const; virtual int rtti() const; - // not const as this can create children on demand - virtual TreeMapItemList* children(); + // not const as this can create tqchildren on demand + virtual TreeMapItemList* tqchildren(); protected: - TreeMapItemList* _children; + TreeMapItemList* _tqchildren; double _sum, _value; private: @@ -372,7 +372,7 @@ private: int _sortTextNo; bool _sortAscending; - // temporary layout + // temporary tqlayout TQRect _rect; TQPtrList<TQRect>* _freeRects; int _depth; @@ -389,18 +389,19 @@ private: * Class for visualisation of a metric of hierarchically * nested items as 2D areas. */ -class TreeMapWidget: public QWidget +class TreeMapWidget: public TQWidget { Q_OBJECT + TQ_OBJECT public: /** - * Same as in QListBox/QListView + * Same as in TQListBox/TQListView */ enum SelectionMode { Single, Multi, Extended, NoSelection }; - TreeMapWidget(TreeMapItem* base, TQWidget* parent=0, const char* name=0); + TreeMapWidget(TreeMapItem* base, TQWidget* tqparent=0, const char* name=0); ~TreeMapWidget(); /** @@ -427,7 +428,7 @@ public: /** * Returns the item possible for selection. this returns the - * given item itself or a parent thereof, + * given item itself or a tqparent thereof, * depending on setting of maxSelectDepth(). */ TreeMapItem* possibleSelection(TreeMapItem*) const; @@ -435,7 +436,7 @@ public: /** * Selects or unselects an item. * In multiselection mode, the constrain that a selected item - * has no selected children or parents stays true. + * has no selected tqchildren or tqparents stays true. */ void setSelected(TreeMapItem*, bool selected = true); @@ -451,19 +452,19 @@ public: void setMarked(int markNo = 1, bool redraw = true); /** - * Clear selection of all selected items which are children of - * parent. When parent == 0, clears whole selection + * Clear selection of all selected items which are tqchildren of + * tqparent. When tqparent == 0, clears whole selection * Returns true if selection changed. */ - bool clearSelection(TreeMapItem* parent = 0); + bool clearSelection(TreeMapItem* tqparent = 0); /** * Selects or unselects items in a range. * This is needed internally for Shift-Click in Extented mode. * Range means for a hierarchical widget: * - select/unselect i1 and i2 according selected - * - search common parent of i1 and i2, and select/unselect the - * range of direct children between but excluding the child + * - search common tqparent of i1 and i2, and select/unselect the + * range of direct tqchildren between but excluding the child * leading to i1 and the child leading to i2. */ void setRangeSelection(TreeMapItem* i1, @@ -516,15 +517,15 @@ public: void setVisibleWidth(int width, bool reuseSpace = false); /** - * If a children value() is almost the parents sum(), + * If a tqchildren value() is almost the tqparents sum(), * it can happen that the border to be drawn for visibilty of * nesting relations takes to much space, and the - * parent/child size relation can not be mapped to a correct + * tqparent/child size relation can not be mapped to a correct * area size relation. * * Either * (1) Ignore the incorrect drawing, or - * (2) Skip drawing of the parent level alltogether. + * (2) Skip drawing of the tqparent level alltogether. */ void setSkipIncorrectBorder(bool enable = true); bool skipIncorrectBorder() const { return _skipIncorrectBorder; } @@ -598,8 +599,8 @@ public: /** * Save/restore options. */ - void saveOptions(KConfigGroup*, TQString prefix = TQString::null); - void restoreOptions(KConfigGroup*, TQString prefix = TQString::null); + void saveOptions(KConfigGroup*, TQString prefix = TQString()); + void restoreOptions(KConfigGroup*, TQString prefix = TQString()); /** * These functions populate given popup menus. @@ -628,7 +629,7 @@ public: virtual TQString tipString(TreeMapItem* i) const; /** - * Redraws an item with all children. + * Redraws an item with all tqchildren. * This takes changed values(), sums(), colors() and text() into account. */ void redraw(TreeMapItem*); |