Qt 4.8
|
The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class. More...
#include <qtreewidget.h>
Public Types | |
enum | ChildIndicatorPolicy { ShowIndicator, DontShowIndicator, DontShowIndicatorWhenChildless } |
enum | ItemType { Type = 0, UserType = 1000 } |
This enum describes the types that are used to describe tree widget items. More... | |
Public Functions | |
void | addChild (QTreeWidgetItem *child) |
Appends the child item to the list of children. More... | |
void | addChildren (const QList< QTreeWidgetItem *> &children) |
Appends the given list of children to the item. More... | |
QBrush | background (int column) const |
Returns the brush used to render the background of the specified column. More... | |
QColor | backgroundColor (int column) const |
This function is deprecated. More... | |
Qt::CheckState | checkState (int column) const |
Returns the check state of the label in the given column. More... | |
QTreeWidgetItem * | child (int index) const |
Returns the item at the given index in the list of the item's children. More... | |
int | childCount () const |
Returns the number of child items. More... | |
QTreeWidgetItem::ChildIndicatorPolicy | childIndicatorPolicy () const |
Returns the item indicator policy. More... | |
virtual QTreeWidgetItem * | clone () const |
Creates a deep copy of the item and of its children. More... | |
int | columnCount () const |
Returns the number of columns in the item. More... | |
virtual QVariant | data (int column, int role) const |
Returns the value for the item's column and role. More... | |
Qt::ItemFlags | flags () const |
Returns the flags used to describe the item. More... | |
QFont | font (int column) const |
Returns the font used to render the text in the specified column. More... | |
QBrush | foreground (int column) const |
Returns the brush used to render the foreground (e. More... | |
QIcon | icon (int column) const |
Returns the icon that is displayed in the specified column. More... | |
int | indexOfChild (QTreeWidgetItem *child) const |
Returns the index of the given child in the item's list of children. More... | |
void | insertChild (int index, QTreeWidgetItem *child) |
Inserts the child item at index in the list of children. More... | |
void | insertChildren (int index, const QList< QTreeWidgetItem *> &children) |
Inserts the given list of children into the list of the item children at index . More... | |
bool | isDisabled () const |
Returns true if the item is disabled; otherwise returns false. More... | |
bool | isExpanded () const |
Returns true if the item is expanded, otherwise returns false. More... | |
bool | isFirstColumnSpanned () const |
Returns true if the item is spanning all the columns in a row; otherwise returns false. More... | |
bool | isHidden () const |
Returns true if the item is hidden, otherwise returns false. More... | |
bool | isSelected () const |
Returns true if the item is selected, otherwise returns false. More... | |
virtual bool | operator< (const QTreeWidgetItem &other) const |
Returns true if the text in the item is less than the text in the other item, otherwise returns false. More... | |
QTreeWidgetItem & | operator= (const QTreeWidgetItem &other) |
Assigns other's data and flags to this item. More... | |
QTreeWidgetItem * | parent () const |
Returns the item's parent. More... | |
QTreeWidgetItem (int type=Type) | |
Constructs a tree widget item of the specified type. More... | |
QTreeWidgetItem (const QStringList &strings, int type=Type) | |
Constructs a tree widget item of the specified type. More... | |
QTreeWidgetItem (QTreeWidget *view, int type=Type) | |
Constructs a tree widget item of the specified type and appends it to the items in the given parent. More... | |
QTreeWidgetItem (QTreeWidget *view, const QStringList &strings, int type=Type) | |
Constructs a tree widget item of the specified type and appends it to the items in the given parent. More... | |
QTreeWidgetItem (QTreeWidget *view, QTreeWidgetItem *after, int type=Type) | |
Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item. More... | |
QTreeWidgetItem (QTreeWidgetItem *parent, int type=Type) | |
Constructs a tree widget item and append it to the given parent. More... | |
QTreeWidgetItem (QTreeWidgetItem *parent, const QStringList &strings, int type=Type) | |
Constructs a tree widget item and append it to the given parent. More... | |
QTreeWidgetItem (QTreeWidgetItem *parent, QTreeWidgetItem *after, int type=Type) | |
Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item. More... | |
QTreeWidgetItem (const QTreeWidgetItem &other) | |
Constructs a copy of other. More... | |
virtual void | read (QDataStream &in) |
Reads the item from stream in. More... | |
void | removeChild (QTreeWidgetItem *child) |
Removes the given item indicated by child. More... | |
void | setBackground (int column, const QBrush &brush) |
Sets the background brush of the label in the given column to the specified brush. More... | |
void | setBackgroundColor (int column, const QColor &color) |
This function is deprecated. More... | |
void | setCheckState (int column, Qt::CheckState state) |
Sets the item in the given column check state to be state. More... | |
void | setChildIndicatorPolicy (QTreeWidgetItem::ChildIndicatorPolicy policy) |
Sets the item indicator policy. More... | |
virtual void | setData (int column, int role, const QVariant &value) |
Sets the value for the item's column and role to the given value. More... | |
void | setDisabled (bool disabled) |
Disables the item if disabled is true; otherwise enables the item. More... | |
void | setExpanded (bool expand) |
Expands the item if expand is true, otherwise collapses the item. More... | |
void | setFirstColumnSpanned (bool span) |
Sets the first section to span all columns if span is true; otherwise all item sections are shown. More... | |
void | setFlags (Qt::ItemFlags flags) |
Sets the flags for the item to the given flags. More... | |
void | setFont (int column, const QFont &font) |
Sets the font used to display the text in the given column to the given font. More... | |
void | setForeground (int column, const QBrush &brush) |
Sets the foreground brush of the label in the given column to the specified brush. More... | |
void | setHidden (bool hide) |
Hides the item if hide is true, otherwise shows the item. More... | |
void | setIcon (int column, const QIcon &icon) |
Sets the icon to be displayed in the given column to icon. More... | |
void | setSelected (bool select) |
Sets the selected state of the item to select. More... | |
void | setSizeHint (int column, const QSize &size) |
Sets the size hint for the tree item in the given column to be size. More... | |
void | setStatusTip (int column, const QString &statusTip) |
Sets the status tip for the given column to the given statusTip. More... | |
void | setText (int column, const QString &text) |
Sets the text to be displayed in the given column to the given text. More... | |
void | setTextAlignment (int column, int alignment) |
Sets the text alignment for the label in the given column to the alignment specified (see Qt::AlignmentFlag). More... | |
void | setTextColor (int column, const QColor &color) |
This function is deprecated. More... | |
void | setToolTip (int column, const QString &toolTip) |
Sets the tooltip for the given column to toolTip. More... | |
void | setWhatsThis (int column, const QString &whatsThis) |
Sets the "What's This?" help for the given column to whatsThis. More... | |
QSize | sizeHint (int column) const |
Returns the size hint set for the tree item in the given column (see QSize). More... | |
void | sortChildren (int column, Qt::SortOrder order) |
Sorts the children of the item using the given order, by the values in the given column. More... | |
QString | statusTip (int column) const |
Returns the status tip for the contents of the given column. More... | |
QTreeWidgetItem * | takeChild (int index) |
Removes the item at index and returns it, otherwise return 0. More... | |
QList< QTreeWidgetItem * > | takeChildren () |
Removes the list of children and returns it, otherwise returns an empty list. More... | |
QString | text (int column) const |
Returns the text in the specified column. More... | |
int | textAlignment (int column) const |
Returns the text alignment for the label in the given column (see Qt::AlignmentFlag). More... | |
QColor | textColor (int column) const |
This function is deprecated. More... | |
QString | toolTip (int column) const |
Returns the tool tip for the given column. More... | |
QTreeWidget * | treeWidget () const |
Returns the tree widget that contains the item. More... | |
int | type () const |
Returns the type passed to the QTreeWidgetItem constructor. More... | |
QString | whatsThis (int column) const |
Returns the "What's This?" help for the contents of the given column. More... | |
virtual void | write (QDataStream &out) const |
Writes the item to stream out. More... | |
virtual | ~QTreeWidgetItem () |
Destroys this tree widget item. More... | |
Protected Functions | |
void | emitDataChanged () |
Causes the model associated with this item to emit a dataChanged() signal for this item. More... | |
Private Functions | |
QVariant | childrenCheckState (int column) const |
Calculates the checked state of the item based on the checked state of its children. More... | |
void | executePendingSort () const |
void | itemChanged () |
void | sortChildren (int column, Qt::SortOrder order, bool climb) |
Sorts the children by the value in the given column, in the order specified. More... | |
Properties | |
QList< QTreeWidgetItem * > | children |
QTreeWidgetItemPrivate * | d |
Qt::ItemFlags | itemFlags |
QTreeWidgetItem * | par |
int | rtti |
QVector< QVector< QWidgetItemData > > | values |
QTreeWidget * | view |
Friends | |
class | QTreeModel |
class | QTreeWidget |
class | QTreeWidgetItemIterator |
class | QTreeWidgetItemPrivate |
class | QTreeWidgetPrivate |
Related Functions | |
(Note that these are not member functions.) | |
QDataStream & | operator<< (QDataStream &out, const QTreeWidgetItem &item) |
Writes the tree widget item item to stream out. More... | |
QDataStream & | operator>> (QDataStream &in, QTreeWidgetItem &item) |
Reads a tree widget item from stream in into item. More... | |
The QTreeWidgetItem class provides an item for use with the QTreeWidget convenience class.
Tree widget items are used to hold rows of information for tree widgets. Rows usually contain several columns of data, each of which can contain a text label and an icon.
The QTreeWidgetItem class is a convenience class that replaces the QListViewItem class in Qt 3. It provides an item for use with the QTreeWidget class.
Items are usually constructed with a parent that is either a QTreeWidget (for top-level items) or a QTreeWidgetItem (for items on lower levels of the tree). For example, the following code constructs a top-level item to represent cities of the world, and adds a entry for Oslo as a child item:
Items can be added in a particular order by specifying the item they follow when they are constructed:
Each column in an item can have its own background brush which is set with the setBackground() function. The current background brush can be found with background(). The text label for each column can be rendered with its own font and brush. These are specified with the setFont() and setForeground() functions, and read with font() and foreground().
The main difference between top-level items and those in lower levels of the tree is that a top-level item has no parent(). This information can be used to tell the difference between items, and is useful to know when inserting and removing items from the tree. Children of an item can be removed with takeChild() and inserted at a given index in the list of children with the insertChild() function.
By default, items are enabled, selectable, checkable, and can be the source of a drag and drop operation. Each item's flags can be changed by calling setFlags() with the appropriate value (see Qt::ItemFlags). Checkable items can be checked and unchecked with the setCheckState() function. The corresponding checkState() function indicates whether the item is currently checked.
When subclassing QTreeWidgetItem to provide custom items, it is possible to define new types for them so that they can be distinguished from standard items. The constructors for subclasses that require this feature need to call the base class constructor with a new type value equal to or greater than UserType .
Definition at line 63 of file qtreewidget.h.
Enumerator | |
---|---|
ShowIndicator | |
DontShowIndicator | |
DontShowIndicatorWhenChildless |
Definition at line 102 of file qtreewidget.h.
This enum describes the types that are used to describe tree widget items.
You can define new user types in QTreeWidgetItem subclasses to ensure that custom items are treated specially; for example, when items are sorted.
Enumerator | |
---|---|
Type | |
UserType |
Definition at line 71 of file qtreewidget.h.
|
explicit |
Constructs a tree widget item of the specified type.
The item must be inserted into a tree widget.
Definition at line 1489 of file qtreewidget.cpp.
Referenced by clone().
QTreeWidgetItem::QTreeWidgetItem | ( | const QStringList & | strings, |
int | type = Type |
||
) |
Constructs a tree widget item of the specified type.
The item must be inserted into a tree widget. The given list of strings will be set as the item text for each column in the item.
Definition at line 1508 of file qtreewidget.cpp.
|
explicit |
Constructs a tree widget item of the specified type and appends it to the items in the given parent.
Definition at line 1529 of file qtreewidget.cpp.
QTreeWidgetItem::QTreeWidgetItem | ( | QTreeWidget * | parent, |
const QStringList & | strings, | ||
int | type = Type |
||
) |
Constructs a tree widget item of the specified type and appends it to the items in the given parent.
The given list of strings will be set as the item text for each column in the item.
Definition at line 1554 of file qtreewidget.cpp.
QTreeWidgetItem::QTreeWidgetItem | ( | QTreeWidget * | parent, |
QTreeWidgetItem * | preceding, | ||
int | type = Type |
||
) |
Constructs a tree widget item of the specified type and inserts it into the given parent after the preceding item.
Definition at line 1579 of file qtreewidget.cpp.
|
explicit |
Constructs a tree widget item and append it to the given parent.
Definition at line 1602 of file qtreewidget.cpp.
QTreeWidgetItem::QTreeWidgetItem | ( | QTreeWidgetItem * | parent, |
const QStringList & | strings, | ||
int | type = Type |
||
) |
Constructs a tree widget item and append it to the given parent.
The given list of strings will be set as the item text for each column in the item.
Definition at line 1620 of file qtreewidget.cpp.
QTreeWidgetItem::QTreeWidgetItem | ( | QTreeWidgetItem * | parent, |
QTreeWidgetItem * | preceding, | ||
int | type = Type |
||
) |
Constructs a tree widget item of the specified type that is inserted into the parent after the preceding child item.
Definition at line 1642 of file qtreewidget.cpp.
QTreeWidgetItem::QTreeWidgetItem | ( | const QTreeWidgetItem & | other | ) |
Constructs a copy of other.
Note that type() and treeWidget() are not copied.
This function is useful when reimplementing clone().
Definition at line 2045 of file qtreewidget.cpp.
|
virtual |
Destroys this tree widget item.
The item will be removed from QTreeWidget to which it has been added. This makes it safe to delete an item at any time.
Definition at line 1664 of file qtreewidget.cpp.
void QTreeWidgetItem::addChild | ( | QTreeWidgetItem * | child | ) |
Appends the child item to the list of children.
Definition at line 2075 of file qtreewidget.cpp.
Referenced by QTreeWidgetItem().
void QTreeWidgetItem::addChildren | ( | const QList< QTreeWidgetItem *> & | children | ) |
Appends the given list of children to the item.
Definition at line 2181 of file qtreewidget.cpp.
|
inline |
Returns the brush used to render the background of the specified column.
Definition at line 147 of file qtreewidget.h.
|
inline |
This function is deprecated.
Use background() instead.
Definition at line 142 of file qtreewidget.h.
|
inline |
Returns the check state of the label in the given column.
Definition at line 162 of file qtreewidget.h.
Referenced by QTreeWidgetItemIterator::matchesFlags().
|
inline |
Returns the item at the given index in the list of the item's children.
Definition at line 184 of file qtreewidget.h.
Referenced by addChild(), QTreeModel::beginRemoveItems(), clone(), QTreeModel::index(), insertChildren(), QTreeWidgetItemIteratorPrivate::next(), QTreeWidgetItemIteratorPrivate::nextSibling(), QTreeWidgetItemIteratorPrivate::previous(), QTreeWidgetItemPrivate::propagateDisabled(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), setData(), setFlags(), and ~QTreeWidgetItem().
|
inline |
Returns the number of child items.
Definition at line 190 of file qtreewidget.h.
Referenced by QTreeModel::clear(), clone(), QTreeWidget::dropEvent(), QTreeModel::hasChildren(), insertChildren(), QTreeWidgetItemIterator::matchesFlags(), QTreeWidgetItemIteratorPrivate::next(), QTreeWidgetItemIteratorPrivate::previous(), and QTreeModel::rowCount().
QTreeWidgetItem::ChildIndicatorPolicy QTreeWidgetItem::childIndicatorPolicy | ( | ) | const |
Returns the item indicator policy.
This policy decides when the tree branch expand/collapse indicator is shown.
Definition at line 1779 of file qtreewidget.cpp.
|
private |
Calculates the checked state of the item based on the checked state of its children.
E.g. if all children checked => this item is also checked; if some children checked => this item is partially checked; if no children checked => this item is unchecked.
Definition at line 2335 of file qtreewidget.cpp.
Referenced by data().
|
virtual |
Creates a deep copy of the item and of its children.
Definition at line 1718 of file qtreewidget.cpp.
|
inline |
Returns the number of columns in the item.
Definition at line 191 of file qtreewidget.h.
Referenced by QTreeModel::columnCount(), insertChild(), QTreeModel::itemChanged(), QTreeWidgetItem(), and QTreeWidget::setHeaderItem().
|
virtual |
Returns the value for the item's column and role.
Definition at line 1956 of file qtreewidget.cpp.
Referenced by childrenCheckState(), QTreeModel::data(), QTreeModel::headerData(), QTreeModel::itemData(), operator<(), and setData().
|
protected |
Causes the model associated with this item to emit a dataChanged() signal for this item.
You normally only need to call this function if you have subclassed QTreeWidgetItem and reimplemented data() and/or setData().
Definition at line 2385 of file qtreewidget.cpp.
|
private |
Definition at line 2402 of file qtreewidget.cpp.
Qt::ItemFlags QTreeWidgetItem::flags | ( | ) | const |
Returns the flags used to describe the item.
These determine whether the item can be checked, edited, and selected.
The default value for flags is Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsDragEnabled. If the item was constructed with a parent, flags will in addition contain Qt::ItemIsDropEnabled.
Definition at line 1869 of file qtreewidget.cpp.
Referenced by QTreeWidgetItemIteratorPrivate::ensureValidIterator(), QTreeModel::flags(), isDisabled(), QTreeWidgetItemIterator::matchesFlags(), setDisabled(), and setFlags().
|
inline |
Returns the font used to render the text in the specified column.
Definition at line 133 of file qtreewidget.h.
|
inline |
Returns the brush used to render the foreground (e.
g. text) of the specified column.
Definition at line 157 of file qtreewidget.h.
|
inline |
Returns the icon that is displayed in the specified column.
Definition at line 113 of file qtreewidget.h.
|
inline |
Returns the index of the given child in the item's list of children.
Definition at line 250 of file qtreewidget.h.
Referenced by QTreeWidgetItemIteratorPrivate::ensureValidIterator(), and QTreeWidgetItemIteratorPrivate::nextSibling().
void QTreeWidgetItem::insertChild | ( | int | index, |
QTreeWidgetItem * | child | ||
) |
Inserts the child item at index in the list of children.
If the child has already been inserted somewhere else it wont be inserted again.
Definition at line 2088 of file qtreewidget.cpp.
Referenced by addChild(), QTreeWidget::dropEvent(), insertChildren(), and QTreeWidgetItem().
void QTreeWidgetItem::insertChildren | ( | int | index, |
const QList< QTreeWidgetItem *> & | children | ||
) |
Inserts the given list of children into the list of the item children at index .
Children that have already been inserted somewhere else wont be inserted.
Definition at line 2196 of file qtreewidget.cpp.
Referenced by addChildren().
|
inline |
Returns true if the item is disabled; otherwise returns false.
Definition at line 423 of file qtreewidget.h.
|
inline |
Returns true if the item is expanded, otherwise returns false.
Definition at line 411 of file qtreewidget.h.
|
inline |
Returns true if the item is spanning all the columns in a row; otherwise returns false.
Definition at line 417 of file qtreewidget.h.
|
inline |
Returns true if the item is hidden, otherwise returns false.
Definition at line 405 of file qtreewidget.h.
Referenced by QTreeWidgetItemIterator::matchesFlags().
|
inline |
Returns true if the item is selected, otherwise returns false.
Definition at line 399 of file qtreewidget.h.
Referenced by QTreeWidgetItemIterator::matchesFlags().
|
private |
Definition at line 2393 of file qtreewidget.cpp.
Referenced by emitDataChanged(), QTreeWidgetItemPrivate::propagateDisabled(), and setFlags().
|
virtual |
Returns true if the text in the item is less than the text in the other item, otherwise returns false.
Definition at line 1985 of file qtreewidget.cpp.
QTreeWidgetItem & QTreeWidgetItem::operator= | ( | const QTreeWidgetItem & | other | ) |
Assigns other's data and flags to this item.
Note that type() and treeWidget() are not copied.
This function is useful when reimplementing clone().
Definition at line 2061 of file qtreewidget.cpp.
|
inline |
Returns the item's parent.
Definition at line 183 of file qtreewidget.h.
Referenced by clone(), QTreeWidget::dropEvent(), QTreeWidgetItemIteratorPrivate::ensureValidIterator(), QTreeModel::index(), QTreeWidgetItemIteratorPrivate::next(), QTreeWidgetItemIteratorPrivate::nextSibling(), QTreeModel::parent(), QTreeWidgetItemIteratorPrivate::previous(), QTreeWidgetItemPrivate::propagateDisabled(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), and setFlags().
|
virtual |
Reads the item from stream in.
This only reads data into a single item.
Definition at line 2000 of file qtreewidget.cpp.
Referenced by operator>>().
void QTreeWidgetItem::removeChild | ( | QTreeWidgetItem * | child | ) |
Removes the given item indicated by child.
The removed item will not be deleted.
Definition at line 2131 of file qtreewidget.cpp.
|
inline |
Sets the background brush of the label in the given column to the specified brush.
Definition at line 149 of file qtreewidget.h.
|
inline |
This function is deprecated.
Use setBackground() instead.
Definition at line 144 of file qtreewidget.h.
|
inline |
Sets the item in the given column check state to be state.
Definition at line 164 of file qtreewidget.h.
void QTreeWidgetItem::setChildIndicatorPolicy | ( | QTreeWidgetItem::ChildIndicatorPolicy | policy | ) |
Sets the item indicator policy.
This policy decides when the tree branch expand/collapse indicator is shown. The default value is ShowForChildren.
Definition at line 1761 of file qtreewidget.cpp.
|
virtual |
Sets the value for the item's column and role to the given value.
The role describes the type of data specified by value, and is defined by the Qt::ItemDataRole enum.
Definition at line 1881 of file qtreewidget.cpp.
Referenced by QTreeModel::setData(), setData(), and QTreeModel::setHeaderData().
|
inline |
Disables the item if disabled is true; otherwise enables the item.
Definition at line 420 of file qtreewidget.h.
|
inline |
Expands the item if expand is true, otherwise collapses the item.
Definition at line 408 of file qtreewidget.h.
|
inline |
Sets the first section to span all columns if span is true; otherwise all item sections are shown.
Definition at line 414 of file qtreewidget.h.
void QTreeWidgetItem::setFlags | ( | Qt::ItemFlags | flags | ) |
Sets the flags for the item to the given flags.
These determine whether the item can be selected or modified. This is often used to disable an item.
Definition at line 1795 of file qtreewidget.cpp.
Referenced by setDisabled().
|
inline |
Sets the font used to display the text in the given column to the given font.
Definition at line 247 of file qtreewidget.h.
|
inline |
Sets the foreground brush of the label in the given column to the specified brush.
Definition at line 159 of file qtreewidget.h.
|
inline |
Hides the item if hide is true, otherwise shows the item.
Definition at line 402 of file qtreewidget.h.
|
inline |
Sets the icon to be displayed in the given column to icon.
Definition at line 229 of file qtreewidget.h.
|
inline |
Sets the selected state of the item to select.
Definition at line 396 of file qtreewidget.h.
|
inline |
Sets the size hint for the tree item in the given column to be size.
If no size hint is set, the item delegate will compute the size hint based on the item data.
Definition at line 169 of file qtreewidget.h.
|
inline |
Sets the status tip for the given column to the given statusTip.
QTreeWidget mouse tracking needs to be enabled for this feature to work.
Definition at line 233 of file qtreewidget.h.
|
inline |
Sets the text to be displayed in the given column to the given text.
Definition at line 226 of file qtreewidget.h.
Referenced by QTreeWidgetItem(), and QTreeWidget::setHeaderLabels().
|
inline |
Sets the text alignment for the label in the given column to the alignment specified (see Qt::AlignmentFlag).
Definition at line 139 of file qtreewidget.h.
|
inline |
This function is deprecated.
Use setForeground() instead.
Definition at line 154 of file qtreewidget.h.
|
inline |
Sets the tooltip for the given column to toolTip.
Definition at line 238 of file qtreewidget.h.
|
inline |
Sets the "What's This?" help for the given column to whatsThis.
Definition at line 243 of file qtreewidget.h.
|
inline |
Returns the size hint set for the tree item in the given column (see QSize).
Definition at line 167 of file qtreewidget.h.
|
inline |
Sorts the children of the item using the given order, by the values in the given column.
Definition at line 204 of file qtreewidget.h.
Referenced by QTreeModel::sort().
|
private |
Sorts the children by the value in the given column, in the order specified.
If climb is true, the items below each of the children will also be sorted.
Definition at line 2308 of file qtreewidget.cpp.
|
inline |
Returns the status tip for the contents of the given column.
Definition at line 117 of file qtreewidget.h.
QTreeWidgetItem * QTreeWidgetItem::takeChild | ( | int | index | ) |
Removes the item at index and returns it, otherwise return 0.
Definition at line 2139 of file qtreewidget.cpp.
Referenced by QTreeWidget::dropEvent(), and QTreeModel::removeRows().
QList< QTreeWidgetItem * > QTreeWidgetItem::takeChildren | ( | ) |
Removes the list of children and returns it, otherwise returns an empty list.
Definition at line 2248 of file qtreewidget.cpp.
|
inline |
Returns the text in the specified column.
Definition at line 109 of file qtreewidget.h.
|
inline |
Returns the text alignment for the label in the given column (see Qt::AlignmentFlag).
Definition at line 137 of file qtreewidget.h.
|
inline |
This function is deprecated.
Use foreground() instead.
Definition at line 152 of file qtreewidget.h.
|
inline |
Returns the tool tip for the given column.
Definition at line 122 of file qtreewidget.h.
|
inline |
Returns the tree widget that contains the item.
Definition at line 85 of file qtreewidget.h.
Referenced by QTreeWidgetItemIteratorPrivate::ensureValidIterator(), and QTreeWidgetItemIteratorPrivate::nextSibling().
|
inline |
Returns the type passed to the QTreeWidgetItem constructor.
Definition at line 203 of file qtreewidget.h.
|
inline |
Returns the "What's This?" help for the contents of the given column.
Definition at line 128 of file qtreewidget.h.
|
virtual |
Writes the item to stream out.
This only writes data from one single item.
Definition at line 2026 of file qtreewidget.cpp.
Referenced by operator<<().
|
related |
Writes the tree widget item item to stream out.
This operator uses QTreeWidgetItem::write().
Definition at line 2422 of file qtreewidget.cpp.
|
related |
Reads a tree widget item from stream in into item.
This operator uses QTreeWidgetItem::read().
Definition at line 2440 of file qtreewidget.cpp.
|
friend |
Definition at line 65 of file qtreewidget.h.
|
friend |
Definition at line 66 of file qtreewidget.h.
|
friend |
Definition at line 68 of file qtreewidget.h.
|
friend |
Definition at line 69 of file qtreewidget.h.
|
friend |
Definition at line 67 of file qtreewidget.h.
|
private |
Definition at line 222 of file qtreewidget.h.
Referenced by addChild(), addChildren(), childrenCheckState(), QTreeModel::clear(), clone(), data(), QTreeModel::ensureSorted(), QTreeModel::index(), insertChild(), insertChildren(), QTreeModel::insertColumns(), QTreeModel::insertRows(), QTreeWidgetItemPrivate::propagateDisabled(), QTreeWidgetItem(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), QTreeModel::removeRows(), setData(), setFlags(), takeChild(), takeChildren(), and ~QTreeWidgetItem().
|
private |
Definition at line 220 of file qtreewidget.h.
Referenced by QTreeWidgetPrivate::_q_selectionChanged(), addChild(), childIndicatorPolicy(), data(), QTreeModel::hasChildren(), QTreeModel::index(), insertChild(), insertChildren(), QTreeModel::insertColumns(), QTreeWidget::isItemSelected(), operator=(), QTreeWidgetItemPrivate::propagateDisabled(), QTreeWidgetItem(), read(), setChildIndicatorPolicy(), QTreeModel::setColumnCount(), setData(), setFlags(), QTreeWidget::setItemSelected(), sortChildren(), takeChild(), takeChildren(), write(), and ~QTreeWidgetItem().
|
private |
Definition at line 223 of file qtreewidget.h.
Referenced by data(), flags(), operator=(), QTreeWidgetItemPrivate::propagateDisabled(), QTreeModel::QTreeModel(), setData(), and setFlags().
|
private |
Definition at line 221 of file qtreewidget.h.
Referenced by QTreeModel::clear(), clone(), insertChild(), insertChildren(), QTreeModel::insertRows(), QTreeWidgetItemPrivate::propagateDisabled(), setData(), setFlags(), takeChild(), takeChildren(), and ~QTreeWidgetItem().
|
private |
Definition at line 216 of file qtreewidget.h.
|
private |
Definition at line 218 of file qtreewidget.h.
Referenced by data(), insertChild(), QTreeModel::insertColumns(), QTreeModel::itemData(), QTreeWidget::mimeData(), operator=(), QTreeWidgetItem(), read(), QTreeModel::setColumnCount(), setData(), and write().
|
private |
Definition at line 219 of file qtreewidget.h.
Referenced by QTreeModel::clear(), executePendingSort(), insertChild(), insertChildren(), QTreeModel::insertRows(), isExpanded(), isFirstColumnSpanned(), isHidden(), isSelected(), itemChanged(), operator<(), QTreeModel::QTreeModel(), QTreeWidgetItemIterator::QTreeWidgetItemIterator(), QTreeModel::removeRows(), setChildIndicatorPolicy(), QTreeModel::setColumnCount(), setData(), setExpanded(), setFirstColumnSpanned(), QTreeWidget::setHeaderItem(), setHidden(), setSelected(), sortChildren(), takeChild(), takeChildren(), QTreeModel::~QTreeModel(), and ~QTreeWidgetItem().