kmobiletools
TreeItem Class Reference
#include <treeitem.h>

Detailed Description
This class represents a generic tree item (inspired from a Qt example).
Definition at line 34 of file treeitem.h.
Public Types | |
| enum | ChildProperty { VisibleChildren = 0, AllChildren = 1 } |
Signals | |
| void | dataChanged (TreeItem *item) |
Public Member Functions | |
| void | appendChild (TreeItem *child) |
| TreeItem * | child (int row) |
| int | childCount (ChildProperty childProperty=VisibleChildren) const |
| QVariant | data () const |
| QFont | font () const |
| QIcon | icon () const |
| TreeItem * | parent () const |
| void | removeChild (TreeItem *child) |
| int | row () const |
| void | setFont (QFont font) |
| void | setIcon (QIcon icon) |
| void | setVisible (bool visible) |
| TreeItem (QString data, TreeItem *parent=0) | |
| bool | visible () const |
| ~TreeItem () | |
Member Enumeration Documentation
Constructor & Destructor Documentation
Definition at line 24 of file treeitem.cpp.
| TreeItem::~TreeItem | ( | ) |
Definition at line 31 of file treeitem.cpp.
Member Function Documentation
| void TreeItem::appendChild | ( | TreeItem * | child | ) |
Appends a child item to the current item.
- Parameters:
-
child the child to append
Definition at line 37 of file treeitem.cpp.
| TreeItem * TreeItem::child | ( | int | row | ) |
Returns the child at the given row.
- Parameters:
-
row the row where the item is located
- Returns:
- the child item
Definition at line 65 of file treeitem.cpp.
| int TreeItem::childCount | ( | ChildProperty | childProperty = VisibleChildren |
) | const |
Returns how many children the item has.
- Parameters:
-
childProperty include items with the property only
- Returns:
- the child count
Definition at line 70 of file treeitem.cpp.
| QVariant TreeItem::data | ( | ) | const |
Returns the data of the current item.
- Returns:
- the item data
Definition at line 88 of file treeitem.cpp.
| void TreeItem::dataChanged | ( | TreeItem * | item | ) | [signal] |
This signal is emitted when the data (text, icon.
..) of this item has changed
- Parameters:
-
item the current item
| QFont TreeItem::font | ( | ) | const |
Returns the font for the current item.
- Returns:
- the item's font
Definition at line 98 of file treeitem.cpp.
| QIcon TreeItem::icon | ( | ) | const |
Returns the icon of the current item.
- Returns:
- the item's icon
Definition at line 93 of file treeitem.cpp.
| TreeItem * TreeItem::parent | ( | ) | const |
| void TreeItem::removeChild | ( | TreeItem * | child | ) |
Removes a child from the current item Please note that the item is NOT deleted.
- Parameters:
-
child the child to remove
Definition at line 42 of file treeitem.cpp.
| int TreeItem::row | ( | ) | const |
Returns the position of this item within its parent.
- Returns:
- the position
Definition at line 108 of file treeitem.cpp.
| void TreeItem::setFont | ( | QFont | font | ) |
| void TreeItem::setIcon | ( | QIcon | icon | ) |
| void TreeItem::setVisible | ( | bool | visible | ) |
Sets whether the item should be displayed in a view.
- Parameters:
-
visible true if the item
Definition at line 57 of file treeitem.cpp.
| bool TreeItem::visible | ( | ) | const |
Returns whether the item is visible to a view.
- Returns:
- true if the item is visible
Definition at line 61 of file treeitem.cpp.
The documentation for this class was generated from the following files:
KDE 4.2 API Reference