Logo Search packages:      
Sourcecode: kdbg version File versions

KTreeView Class Reference

#include <ktreeview.h>

Inheritance diagram for KTreeView:

List of all members.

Detailed Description

A collapsible treelist widget.

KTreeView is a class that provides a way to display hierarchical data in a single-inheritance tree, similar to tree controls in Microsoft Windows and other GUIs. It is most suitable for directory trees or outlines, but I'm sure other uses will come to mind. It was designed mostly with the above two functions in mind, but I have tried to make it as flexible as I can to make it easy to adapt to other uses.

Please read the source code if you have time. I have tried to comment it adequately and make the source understandable.

The class features the following:

Johannes Sixt <Johannes.Sixt@telecom.at>, Keith Brown

Definition at line 402 of file ktreeview.h.

Public Types

typedef bool(* KForEveryFunc )(KTreeViewItem *, void *)

Public Slots

void sbHor (int value)
void sbVer (int value)


void collapsed (int index)
void expanded (int index)
void expanding (KTreeViewItem *item, bool &allow)
void highlighted (int index)
void rightPressed (int index, const QPoint &pt)
void selected (int index)

Public Member Functions

void appendChildItem (KTreeViewItem *newItem, const KPath &path)
void appendChildItem (KTreeViewItem *newItem, int index)
void appendChildItem (const char *text, const QPixmap &pixmap, const KPath &path)
void appendChildItem (const char *text, const QPixmap &pixmap, int index)
bool autoUpdate () const
virtual QPoint cellCoords (int row, const QPoint &widgetCoord)
void changeItem (const char *newText, const QPixmap *newPixmap, const KPath &thePath)
void changeItem (const char *newText, const QPixmap *newPixmap, int index)
void clear ()
void collapseItem (int index, bool emitSignal)
bool colXPos (int col, int *left) const
uint count ()
int currentItem () const
void expandItem (int index, bool emitSignal)
int expandLevel () const
int findCol (int x) const
int findRow (int y) const
bool forEveryItem (KForEveryFunc func, void *user, KTreeViewItem *root=0)
bool forEveryVisibleItem (KForEveryFunc func, void *user, KTreeViewItem *root=0)
KTreeViewItemgetCurrentItem ()
int indentSpacing ()
bool insertItem (KTreeViewItem *newItem, const KPath &thePath, bool prefix=true)
bool insertItem (KTreeViewItem *newItem, int row=-1, bool prefix=true)
bool insertItem (const char *text, const QPixmap &pixmap, const KPath &path, bool prefix=true)
bool insertItem (const char *text, const QPixmap &pixmap, int row=-1, bool prefix=true)
KTreeViewItemitemAt (const KPath &path)
KTreeViewItemitemAt (int row) const
void itemPath (int row, KPath &path)
int itemRow (KTreeViewItem *item)
void join (const KPath &path)
void join (int index)
 KTreeView (QWidget *parent=0, const char *name=0, WFlags f=0)
int lastRowVisible () const
int leftCell () const
void lowerItem (const KPath &path)
void lowerItem (int index)
int maxXOffset () const
int maxYOffset () const
int numCols () const
int numRows () const
void raiseItem (const KPath &path)
void raiseItem (int row)
void removeItem (const KPath &thePath)
void removeItem (int row)
bool rowIsVisible (int row) const
bool rowYPos (int row, int *top) const
void scrollVisible (KTreeViewItem *item, bool children)
void setAutoUpdate (bool update)
void setCurrentItem (int row)
void setExpandButtonDrawing (bool enable)
void setExpandLevel (int level)
void setIndentSpacing (int spacing)
void setMoveCurrentToSibling (bool m=true)
void setNumCols (int cols)
void setNumRows (int rows)
void setOffset (int x, int y)
void setShowItemText (bool enable)
void setTopCell (int row)
void setTreeDrawing (bool enable)
virtual void setupPainter (QPainter *p)
void setXOffset (int x)
void setYOffset (int y)
bool showItemText () const
void split (const KPath &path)
void split (int index)
KTreeViewItemtakeItem (const KPath &path)
KTreeViewItemtakeItem (int index)
int topCell () const
int totalHeight () const
int totalWidth () const
bool treeDrawing () const
void updateCell (int row, int col, bool erase=true)
void updateTableSize ()
int viewHeight () const
int viewWidth () const
int visibleCount () const
int xOffset () const
int yOffset () const
virtual ~KTreeView ()

Protected Member Functions

void appendChildItem (KTreeViewItem *parent, KTreeViewItem *child)
virtual int cellHeight (int row) const
virtual int cellWidth (int col) const
void changeItem (KTreeViewItem *toChange, int itemRow, const char *newText, const QPixmap *newPixmap)
virtual void collapseSubTree (KTreeViewItem *item, bool emitSignal)
void draw_rubberband ()
void end_rubberband ()
virtual void expandSubTree (KTreeViewItem *item, bool emitSignal)
void fixChildren (KTreeViewItem *parentItem)
virtual void focusInEvent (QFocusEvent *e)
virtual void focusOutEvent (QFocusEvent *e)
virtual int indentation (KTreeViewItem *item) const
bool insertItem (KTreeViewItem *referenceItem, KTreeViewItem *newItem, bool prefix)
void itemPath (KTreeViewItem *item, KPath &path) const
void join (KTreeViewItem *item)
virtual void keyPressEvent (QKeyEvent *e)
virtual void keyReleaseEvent (QKeyEvent *e)
int level (KTreeViewItem *item) const
void lowerItem (KTreeViewItem *item)
virtual void mouseDoubleClickEvent (QMouseEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
void move_rubberband (const QPoint &where)
virtual void paintCell (QPainter *p, int row, int col)
virtual void paintEvent (QPaintEvent *ev)
void paletteChange (const QPalette &)
void raiseItem (KTreeViewItem *item)
KTreeViewItemrecursiveFind (KPath &path)
virtual void resizeEvent (QResizeEvent *ev)
void setItemExpanded (KTreeViewItem *item)
void split (KTreeViewItem *item)
void start_rubberband (const QPoint &where)
void takeItem (KTreeViewItem *item)
virtual void updateCellWidth ()
void updateVisibleItemRec (KTreeViewItem *parent, int &count, int &width)
virtual void updateVisibleItems ()
virtual void wheelEvent (QWheelEvent *ev)

Static Protected Member Functions

static bool countItem (KTreeViewItem *item, void *total)
static bool getMaxItemWidth (KTreeViewItem *item, void *user)
static bool setItemExpandButtonDrawing (KTreeViewItem *item, void *)
static bool setItemExpandLevel (KTreeViewItem *item, void *)
static bool setItemShowText (KTreeViewItem *item, void *)
static bool setItemTreeDrawing (KTreeViewItem *item, void *)

Protected Attributes

bool clearing
int current
bool drawExpandButton
bool drawTree
int expansion
bool goingDown
int itemCapacity
int itemIndent
int maxItemWidth
bool moveCurrentToSibling
int rubber_height
QPoint rubber_startMouse
int rubber_startX
int rubber_startY
int rubber_width
bool rubberband_mode
bool showText
KTreeViewItem ** visibleItems


class KTreeViewItem

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index