• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

kcachegrind

Public Types | Public Member Functions | Protected Attributes | List of all members
TreeMapItem Class Reference

#include <treemap.h>

Inheritance diagram for TreeMapItem:
Inheritance graph
[legend]

Public Types

enum  SplitMode {
  Bisection, Columns, Rows, AlwaysBest,
  Best, HAlternate, VAlternate, Horizontal,
  Vertical
}
 
- Public Types inherited from DrawParams
enum  Position {
  TopLeft, TopCenter, TopRight, BottomLeft,
  BottomCenter, BottomRight, Default, Unknown
}
 

Public Member Functions

 TreeMapItem (TreeMapItem *parent=0, double value=1.0)
 
 TreeMapItem (TreeMapItem *parent, double value, const QString &text1, const QString &text2=QString(), const QString &text3=QString(), const QString &text4=QString())
 
virtual ~TreeMapItem ()
 
void addFreeRect (const QRect &r)
 
void addItem (TreeMapItem *)
 
virtual int borderWidth () const
 
virtual TreeMapItemList * children ()
 
void clear ()
 
void clearFreeRects ()
 
void clearItemRect ()
 
TreeMapItem * commonParent (TreeMapItem *item)
 
int depth () const
 
virtual const QFont & font () const
 
const QList< QRect > & freeRects () const
 
int height () const
 
int index () const
 
bool initialized ()
 
bool isChildOf (TreeMapItem *)
 
virtual bool isMarked (int) const
 
const QRect & itemRect () const
 
TreeMapItem * parent () const
 
QStringList path (int) const
 
virtual Position position (int) const
 
void redraw ()
 
void refresh ()
 
void resort (bool recursive=true)
 
virtual int rtti () const
 
void setIndex (int i)
 
void setItemRect (const QRect &r)
 
void setParent (TreeMapItem *p)
 
void setSorting (int textNo, bool ascending=true)
 
void setSum (double s)
 
void setValue (double s)
 
void setWidget (TreeMapWidget *w)
 
virtual int sorting (bool *ascending) const
 
virtual SplitMode splitMode () const
 
virtual double sum () const
 
virtual double value () const
 
TreeMapWidget * widget () const
 
int width () const
 
- Public Member Functions inherited from StoredDrawParams
 StoredDrawParams ()
 
 StoredDrawParams (const QColor &c, bool selected=false, bool current=false)
 
QColor backColor () const
 
bool current () const
 
bool drawFrame () const
 
void drawFrame (bool b)
 
int fieldCount () const
 
int maxLines (int) const
 
QPixmap pixmap (int) const
 
bool rotated () const
 
bool selected () const
 
void setBackColor (const QColor &c)
 
void setCurrent (bool b)
 
void setField (int f, const QString &t, const QPixmap &pm=QPixmap(), Position p=Default, int maxLines=0)
 
void setMaxLines (int f, int)
 
void setPixmap (int f, const QPixmap &)
 
void setPosition (int f, Position)
 
void setRotated (bool b)
 
void setSelected (bool b)
 
void setShaded (bool b)
 
void setText (int f, const QString &)
 
bool shaded () const
 
QString text (int) const
 
- Public Member Functions inherited from DrawParams
virtual ~DrawParams ()
 

Protected Attributes

TreeMapItemList * _children
 
double _sum
 
double _value
 
- Protected Attributes inherited from StoredDrawParams
QColor _backColor
 
bool _current:1
 
bool _drawFrame:1
 
bool _rotated:1
 
bool _selected:1
 
bool _shaded:1
 

Detailed Description

Base class of items in TreeMap.

This class supports an arbitrary number of text() strings positioned counterclock-wise starting at TopLeft. Each item has its own static value(), sum() and sorting(). The splitMode() and borderWidth() is taken from a TreeMapWidget.

If you want more flexibility, reimplement TreeMapItem and override the corresponding methods. For dynamic creation of child items on demand, reimplement children().

Definition at line 221 of file treemap.h.

Member Enumeration Documentation

enum TreeMapItem::SplitMode

Split direction for nested areas: AlwaysBest: Choose split direction for every subitem according to 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.

Enumerator
Bisection 
Columns 
Rows 
AlwaysBest 
Best 
HAlternate 
VAlternate 
Horizontal 
Vertical 

Definition at line 236 of file treemap.h.

Constructor & Destructor Documentation

TreeMapItem::TreeMapItem ( TreeMapItem *  parent = 0,
double  value = 1.0 
)
explicit

Definition at line 836 of file treemap.cpp.

TreeMapItem::TreeMapItem ( TreeMapItem *  parent,
double  value,
const QString &  text1,
const QString &  text2 = QString(),
const QString &  text3 = QString(),
const QString &  text4 = QString() 
)

Definition at line 860 of file treemap.cpp.

TreeMapItem::~TreeMapItem ( )
virtual

Definition at line 883 of file treemap.cpp.

Member Function Documentation

void TreeMapItem::addFreeRect ( const QRect &  r)

Definition at line 1108 of file treemap.cpp.

void TreeMapItem::addItem ( TreeMapItem *  i)

Adds an item to a parent.

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 construction of the item.

Definition at line 982 of file treemap.cpp.

int TreeMapItem::borderWidth ( ) const
virtual

Reimplemented in CallMapCallerItem, CallMapCallingItem, PartItem, and BasePartItem.

Definition at line 1031 of file treemap.cpp.

TreeMapItemList * TreeMapItem::children ( )
virtual

Reimplemented in CallMapCallerItem, SubPartItem, CallMapCallingItem, PartItem, CallMapBaseItem, and BasePartItem.

Definition at line 1089 of file treemap.cpp.

void TreeMapItem::clear ( )

Definition at line 927 of file treemap.cpp.

void TreeMapItem::clearFreeRects ( )

Temporary rectangle list of free space of this item.

Used internally to enable tooltip.

Definition at line 1103 of file treemap.cpp.

void TreeMapItem::clearItemRect ( )

Definition at line 1097 of file treemap.cpp.

TreeMapItem * TreeMapItem::commonParent ( TreeMapItem *  item)

Definition at line 913 of file treemap.cpp.

int TreeMapItem::depth ( ) const

Depth of this item.

This is the distance to root.

Definition at line 963 of file treemap.cpp.

const QFont & TreeMapItem::font ( ) const
virtual

Reimplemented from StoredDrawParams.

Definition at line 1019 of file treemap.cpp.

const QList<QRect>& TreeMapItem::freeRects ( ) const
inline

Definition at line 303 of file treemap.h.

int TreeMapItem::height ( ) const
inline

Definition at line 296 of file treemap.h.

int TreeMapItem::index ( ) const
inline

Temporary child item index of the child that was current() recently.

Definition at line 309 of file treemap.h.

bool TreeMapItem::initialized ( )

Definition at line 973 of file treemap.cpp.

bool TreeMapItem::isChildOf ( TreeMapItem *  item)

Definition at line 901 of file treemap.cpp.

bool TreeMapItem::isMarked ( int  ) const
virtual

Reimplemented in CallMapCallerItem, CallMapCallingItem, and CallMapBaseItem.

Definition at line 1025 of file treemap.cpp.

const QRect& TreeMapItem::itemRect ( ) const
inline

Definition at line 294 of file treemap.h.

TreeMapItem* TreeMapItem::parent ( ) const
inline

Parent Item.

Definition at line 286 of file treemap.h.

QStringList TreeMapItem::path ( int  textNo) const

Returns a list of text strings of specified text number, from root up to this item.

Definition at line 949 of file treemap.cpp.

DrawParams::Position TreeMapItem::position ( int  f) const
virtual

Reimplemented from StoredDrawParams.

Definition at line 1009 of file treemap.cpp.

void TreeMapItem::redraw ( )

Definition at line 921 of file treemap.cpp.

void TreeMapItem::refresh ( )

Definition at line 942 of file treemap.cpp.

void TreeMapItem::resort ( bool  recursive = true)

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 set the recursive parameter to false.

Definition at line 1063 of file treemap.cpp.

int TreeMapItem::rtti ( ) const
virtual

Reimplemented in CallMapCallerItem, SubPartItem, CallMapCallingItem, PartItem, CallMapBaseItem, and BasePartItem.

Definition at line 1084 of file treemap.cpp.

void TreeMapItem::setIndex ( int  i)
inline

Definition at line 310 of file treemap.h.

void TreeMapItem::setItemRect ( const QRect &  r)
inline

Temporary rectangle used for drawing this item the last time.

This is internally used to map from a point to an item.

Definition at line 292 of file treemap.h.

void TreeMapItem::setParent ( TreeMapItem *  p)

Definition at line 895 of file treemap.cpp.

void TreeMapItem::setSorting ( int  textNo,
bool  ascending = true 
)

Set the sorting for child drawing.

Default is no sorting: <textNo> = -1 For value() sorting, use <textNo> = -2

For fast sorting, set this to -1 before child insertions and call again after inserting all children.

Definition at line 1046 of file treemap.cpp.

void TreeMapItem::setSum ( double  s)
inline

Definition at line 320 of file treemap.h.

void TreeMapItem::setValue ( double  s)
inline

Definition at line 321 of file treemap.h.

void TreeMapItem::setWidget ( TreeMapWidget *  w)
inline

Definition at line 319 of file treemap.h.

int TreeMapItem::sorting ( bool *  ascending) const
virtual

Returns the text number after that sorting is done or -1 for no sorting, -2 for value() sorting (default).

If ascending != 0, a bool value is written at that location to indicate if sorting should be ascending.

Definition at line 1039 of file treemap.cpp.

TreeMapItem::SplitMode TreeMapItem::splitMode ( ) const
virtual

Reimplemented in SubPartItem.

Definition at line 1076 of file treemap.cpp.

double TreeMapItem::sum ( ) const
virtual

Reimplemented in SubPartItem, CallMapCallingItem, PartItem, and CallMapBaseItem.

Definition at line 1004 of file treemap.cpp.

double TreeMapItem::value ( ) const
virtual

Reimplemented in CallMapCallerItem, SubPartItem, CallMapCallingItem, PartItem, CallMapBaseItem, and BasePartItem.

Definition at line 999 of file treemap.cpp.

TreeMapWidget* TreeMapItem::widget ( ) const
inline

TreeMap widget this item is put in.

Definition at line 316 of file treemap.h.

int TreeMapItem::width ( ) const
inline

Definition at line 295 of file treemap.h.

Member Data Documentation

TreeMapItemList* TreeMapItem::_children
protected

Definition at line 366 of file treemap.h.

double TreeMapItem::_sum
protected

Definition at line 367 of file treemap.h.

double TreeMapItem::_value
protected

Definition at line 367 of file treemap.h.


The documentation for this class was generated from the following files:
  • treemap.h
  • treemap.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:03:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kcachegrind

Skip menu "kcachegrind"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal