- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions | Friends

# QTreeWidgetItem Class Reference

Search for all occurrences

## Detailed Description

Definition at line 63 of file qtreewidget.h.

`#include <qtreewidget.h>`

List of all members.

## Public Types
enum | ItemType { Type = 0, UserType = 1000 }
enum | ChildIndicatorPolicy { ShowIndicator, DontShowIndicator, DontShowIndicatorWhenChildless }
## Public Member Functions
| QTreeWidgetItem (int type=Type)
| QTreeWidgetItem (const QStringList &strings, int type=Type)
| QTreeWidgetItem (QTreeWidget *view, int type=Type)
| QTreeWidgetItem (QTreeWidget *view, const QStringList &strings, int type=Type)
| QTreeWidgetItem (QTreeWidget *view, QTreeWidgetItem *after, int type=Type)
| QTreeWidgetItem (QTreeWidgetItem *parent, int type=Type)
| QTreeWidgetItem (QTreeWidgetItem *parent, const QStringList &strings, int type=Type)
| QTreeWidgetItem (QTreeWidgetItem *parent, QTreeWidgetItem *after, int type=Type)
| QTreeWidgetItem (const QTreeWidgetItem &other)
virtual | ~QTreeWidgetItem ()
virtual QTreeWidgetItem * | clone () const
QTreeWidget * | treeWidget () const
void | setSelected (bool select)
bool | isSelected () const
void | setHidden (bool hide)
bool | isHidden () const
void | setExpanded (bool expand)
bool | isExpanded () const
void | setFirstColumnSpanned (bool span)
bool | isFirstColumnSpanned () const
void | setDisabled (bool disabled)
bool | isDisabled () const
void | setChildIndicatorPolicy (QTreeWidgetItem::ChildIndicatorPolicy policy)
QTreeWidgetItem::ChildIndicatorPolicy | childIndicatorPolicy () const
Qt::ItemFlags | flags () const
void | setFlags (Qt::ItemFlags flags)
QString | text (int column) const
void | setText (int column, const QString &text)
QIcon | icon (int column) const
void | setIcon (int column, const QIcon &icon)
QString | statusTip (int column) const
void | setStatusTip (int column, const QString &statusTip)
QString | toolTip (int column) const
void | setToolTip (int column, const QString &toolTip)
QString | whatsThis (int column) const
void | setWhatsThis (int column, const QString &whatsThis)
QFont | font (int column) const
void | setFont (int column, const QFont &font)
int | textAlignment (int column) const
void | setTextAlignment (int column, int alignment)
QColor | backgroundColor (int column) const
void | setBackgroundColor (int column, const QColor &color)
QBrush | background (int column) const
void | setBackground (int column, const QBrush &brush)
QColor | textColor (int column) const
void | setTextColor (int column, const QColor &color)
QBrush | foreground (int column) const
void | setForeground (int column, const QBrush &brush)
Qt::CheckState | checkState (int column) const
void | setCheckState (int column, Qt::CheckState state)
QSize | sizeHint (int column) const
void | setSizeHint (int column, const QSize &size)
virtual QVariant | data (int column, int role) const
virtual void | setData (int column, int role, const QVariant &value)
virtual bool | operator< (const QTreeWidgetItem &other) const
virtual void | read (QDataStream &in)
virtual void | write (QDataStream &out) const
QTreeWidgetItem & | operator= (const QTreeWidgetItem &other)
QTreeWidgetItem * | parent () const
QTreeWidgetItem * | child (int index) const
int | childCount () const
int | columnCount () const
int | indexOfChild (QTreeWidgetItem *child) const
void | addChild (QTreeWidgetItem *child)
void | insertChild (int index, QTreeWidgetItem *child)
void | removeChild (QTreeWidgetItem *child)
QTreeWidgetItem * | takeChild (int index)
void | addChildren (const QList< QTreeWidgetItem * > &children)
void | insertChildren (int index, const QList< QTreeWidgetItem * > &children)
QList< QTreeWidgetItem * > | takeChildren ()
int | type () const
void | sortChildren (int column, Qt::SortOrder order)
## Protected Member Functions
void | emitDataChanged ()
## Friends
class | QTreeModel
class | QTreeWidget
class | QTreeWidgetPrivate
class | QTreeWidgetItemIterator
class | QTreeWidgetItemPrivate

## Member Enumeration Documentation

enum ItemType

Search for all occurrences

Enumerator:

  Type | Search for all occurrences
  UserType | Search for all occurrences

Definition at line 71 of file qtreewidget.h.

    { Type = 0, UserType = 1000 };

enum ChildIndicatorPolicy

Search for all occurrences

Enumerator:

  ShowIndicator | Search for all occurrences
  DontShowIndicator | Search for all occurrences
  DontShowIndicatorWhenChildless | Search for all occurrences

Definition at line 102 of file qtreewidget.h.

    { ShowIndicator, DontShowIndicator, DontShowIndicatorWhenChildless };

## Constructor & Destructor Documentation

QTreeWidgetItem | ( | int | type = `Type` | ) | `[explicit]`

QTreeWidgetItem | ( | const QStringList & | strings,
|  | int | type = `Type`
| ) |  |

QTreeWidgetItem | ( | QTreeWidget * | view,
|  | int | type = `Type`
| ) |  | `[explicit]`

QTreeWidgetItem | ( | QTreeWidget * | view,
|  | const QStringList & | strings,
|  | int | type = `Type`
| ) |  |

QTreeWidgetItem | ( | QTreeWidget * | view,
|  | QTreeWidgetItem * | after,
|  | int | type = `Type`
| ) |  |

QTreeWidgetItem | ( | QTreeWidgetItem * | parent,
|  | int | type = `Type`
| ) |  | `[explicit]`

QTreeWidgetItem | ( | QTreeWidgetItem * | parent,
|  | const QStringList & | strings,
|  | int | type = `Type`
| ) |  |

QTreeWidgetItem | ( | QTreeWidgetItem * | parent,
|  | QTreeWidgetItem * | after,
|  | int | type = `Type`
| ) |  |

QTreeWidgetItem | ( | const QTreeWidgetItem & | other | ) |

virtual ~QTreeWidgetItem | ( |  | ) | `[virtual]`

## Member Function Documentation

virtual QTreeWidgetItem* clone | ( |  | ) | const `[virtual]`

Search for all occurrences

QTreeWidget* treeWidget | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 85 of file qtreewidget.h.

    { return view; }

void setSelected | ( | bool | select | ) | `[inline]`

Search for all occurrences

Definition at line 396 of file qtreewidget.h.

    { if (view) view->setItemSelected(this, aselect); }

bool isSelected | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 399 of file qtreewidget.h.

    { return (view ? view->isItemSelected(this) : false); }

void setHidden | ( | bool | hide | ) | `[inline]`

Search for all occurrences

Definition at line 402 of file qtreewidget.h.

    { if (view) view->setItemHidden(this, ahide); }

bool isHidden | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 405 of file qtreewidget.h.

    { return (view ? view->isItemHidden(this) : false); }

void setExpanded | ( | bool | expand | ) | `[inline]`

Search for all occurrences

Definition at line 408 of file qtreewidget.h.

    { if (view) view->setItemExpanded(this, aexpand); }

bool isExpanded | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 411 of file qtreewidget.h.

    { return (view ? view->isItemExpanded(this) : false); }

void setFirstColumnSpanned | ( | bool | span | ) | `[inline]`

Search for all occurrences

Definition at line 414 of file qtreewidget.h.

    { if (view) view->setFirstItemColumnSpanned(this, aspan); }

bool isFirstColumnSpanned | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 417 of file qtreewidget.h.

    { return (view ? view->isFirstItemColumnSpanned(this) : false); }

void setDisabled | ( | bool | disabled | ) | `[inline]`

Search for all occurrences

Definition at line 420 of file qtreewidget.h.

    { setFlags(disabled ? (flags() & ~Qt::ItemIsEnabled) : flags() | Qt::ItemIsEnabled); }

bool isDisabled | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 423 of file qtreewidget.h.

    { return !(flags() & Qt::ItemIsEnabled); }

void setChildIndicatorPolicy | ( | QTreeWidgetItem::ChildIndicatorPolicy | policy | ) |

Search for all occurrences

QTreeWidgetItem::ChildIndicatorPolicy childIndicatorPolicy | ( |  | ) | const

Search for all occurrences

Qt::ItemFlags flags | ( |  | ) | const

Search for all occurrences

void setFlags | ( | Qt::ItemFlags | flags | ) |

Search for all occurrences

QString text | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 109 of file qtreewidget.h.

            { return data(column, Qt::DisplayRole).toString(); }

void setText | ( | int | column,
|  | const QString & | text
| ) |  | `[inline]`

Search for all occurrences

Definition at line 226 of file qtreewidget.h.

    { setData(column, Qt::DisplayRole, atext); }

QIcon icon | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 113 of file qtreewidget.h.

            { return qvariant_cast<QIcon>(data(column, Qt::DecorationRole)); }

void setIcon | ( | int | column,
|  | const QIcon & | icon
| ) |  | `[inline]`

Search for all occurrences

Definition at line 229 of file qtreewidget.h.

    { setData(column, Qt::DecorationRole, aicon); }

QString statusTip | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 117 of file qtreewidget.h.

            { return data(column, Qt::StatusTipRole).toString(); }

void setStatusTip | ( | int | column,
|  | const QString & | statusTip
| ) |  | `[inline]`

Search for all occurrences

Definition at line 233 of file qtreewidget.h.

    { setData(column, Qt::StatusTipRole, astatusTip); }

QString toolTip | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 122 of file qtreewidget.h.

            { return data(column, Qt::ToolTipRole).toString(); }

void setToolTip | ( | int | column,
|  | const QString & | toolTip
| ) |  | `[inline]`

Search for all occurrences

Definition at line 238 of file qtreewidget.h.

    { setData(column, Qt::ToolTipRole, atoolTip); }

QString whatsThis | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 128 of file qtreewidget.h.

            { return data(column, Qt::WhatsThisRole).toString(); }

void setWhatsThis | ( | int | column,
|  | const QString & | whatsThis
| ) |  | `[inline]`

Search for all occurrences

Definition at line 243 of file qtreewidget.h.

    { setData(column, Qt::WhatsThisRole, awhatsThis); }

QFont font | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 133 of file qtreewidget.h.

            { return qvariant_cast<QFont>(data(column, Qt::FontRole)); }

void setFont | ( | int | column,
|  | const QFont & | font
| ) |  | `[inline]`

Search for all occurrences

Definition at line 247 of file qtreewidget.h.

    { setData(column, Qt::FontRole, afont); }

int textAlignment | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 137 of file qtreewidget.h.

            { return data(column, Qt::TextAlignmentRole).toInt(); }

void setTextAlignment | ( | int | column,
|  | int | alignment
| ) |  | `[inline]`

Search for all occurrences

Definition at line 139 of file qtreewidget.h.

            { setData(column, Qt::TextAlignmentRole, alignment); }

QColor backgroundColor | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 142 of file qtreewidget.h.

            { return qvariant_cast<QColor>(data(column, Qt::BackgroundColorRole)); }

void setBackgroundColor | ( | int | column,
|  | const QColor & | color
| ) |  | `[inline]`

Search for all occurrences

Definition at line 144 of file qtreewidget.h.

            { setData(column, Qt::BackgroundColorRole, color); }

QBrush background | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 147 of file qtreewidget.h.

            { return qvariant_cast<QBrush>(data(column, Qt::BackgroundRole)); }

void setBackground | ( | int | column,
|  | const QBrush & | brush
| ) |  | `[inline]`

Search for all occurrences

Definition at line 149 of file qtreewidget.h.

            { setData(column, Qt::BackgroundRole, brush); }

QColor textColor | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 152 of file qtreewidget.h.

            { return qvariant_cast<QColor>(data(column, Qt::TextColorRole)); }

void setTextColor | ( | int | column,
|  | const QColor & | color
| ) |  | `[inline]`

Search for all occurrences

Definition at line 154 of file qtreewidget.h.

            { setData(column, Qt::TextColorRole, color); }

QBrush foreground | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 157 of file qtreewidget.h.

            { return qvariant_cast<QBrush>(data(column, Qt::ForegroundRole)); }

void setForeground | ( | int | column,
|  | const QBrush & | brush
| ) |  | `[inline]`

Search for all occurrences

Definition at line 159 of file qtreewidget.h.

            { setData(column, Qt::ForegroundRole, brush); }

Qt::CheckState checkState | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 162 of file qtreewidget.h.

            { return static_cast<Qt::CheckState>(data(column, Qt::CheckStateRole).toInt()); }

void setCheckState | ( | int | column,
|  | Qt::CheckState | state
| ) |  | `[inline]`

Search for all occurrences

Definition at line 164 of file qtreewidget.h.

            { setData(column, Qt::CheckStateRole, state); }

QSize sizeHint | ( | int | column | ) | const `[inline]`

Search for all occurrences

Definition at line 167 of file qtreewidget.h.

            { return qvariant_cast<QSize>(data(column, Qt::SizeHintRole)); }

void setSizeHint | ( | int | column,
|  | const QSize & | size
| ) |  | `[inline]`

Search for all occurrences

Definition at line 169 of file qtreewidget.h.

            { setData(column, Qt::SizeHintRole, size); }

virtual QVariant data | ( | int | column,
|  | int | role
| ) |  | const `[virtual]`

Search for all occurrences

virtual void setData | ( | int | column,
|  | int | role,
|  | const QVariant & | value
| ) |  | `[virtual]`

Search for all occurrences

virtual bool operator< | ( | const QTreeWidgetItem & | other | ) | const `[virtual]`

virtual void read | ( | QDataStream & | in | ) | `[virtual]`

Search for all occurrences

virtual void write | ( | QDataStream & | out | ) | const `[virtual]`

Search for all occurrences

QTreeWidgetItem& operator= | ( | const QTreeWidgetItem & | other | ) |

QTreeWidgetItem* parent | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 183 of file qtreewidget.h.

    { return par; }

QTreeWidgetItem* child | ( | int | index | ) | const `[inline]`

Search for all occurrences

Definition at line 184 of file qtreewidget.h.

                                                       {
            if (index < 0 || index >= children.size())
                return 0;
            executePendingSort();
            return children.at(index);
        }

int childCount | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 190 of file qtreewidget.h.

    { return children.count(); }

int columnCount | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 191 of file qtreewidget.h.

    { return values.count(); }

int indexOfChild | ( | QTreeWidgetItem * | child | ) | const `[inline]`

Search for all occurrences

Definition at line 250 of file qtreewidget.h.

    { executePendingSort(); return children.indexOf(achild); }

void addChild | ( | QTreeWidgetItem * | child | ) |

Search for all occurrences

void insertChild | ( | int | index,
|  | QTreeWidgetItem * | child
| ) |  |

Search for all occurrences

void removeChild | ( | QTreeWidgetItem * | child | ) |

Search for all occurrences

QTreeWidgetItem* takeChild | ( | int | index | ) |

Search for all occurrences

void addChildren | ( | const QList< QTreeWidgetItem * > & | children | ) |

Search for all occurrences

void insertChildren | ( | int | index,
|  | const QList< QTreeWidgetItem * > & | children
| ) |  |

Search for all occurrences

QList<QTreeWidgetItem*> takeChildren | ( |  | ) |

Search for all occurrences

int type | ( |  | ) | const `[inline]`

Search for all occurrences

Definition at line 203 of file qtreewidget.h.

    { return rtti; }

void sortChildren | ( | int | column,
|  | Qt::SortOrder | order
| ) |  | `[inline]`

Search for all occurrences

Definition at line 204 of file qtreewidget.h.

            { sortChildren(column, order, false); }

void emitDataChanged | ( |  | ) | `[protected]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QTreeModel `[friend]`

Search for all occurrences

Definition at line 65 of file qtreewidget.h.

friend class QTreeWidget `[friend]`

Search for all occurrences

Definition at line 66 of file qtreewidget.h.

friend class QTreeWidgetPrivate `[friend]`

Search for all occurrences

Definition at line 67 of file qtreewidget.h.

friend class QTreeWidgetItemIterator `[friend]`

Search for all occurrences

Definition at line 68 of file qtreewidget.h.

friend class QTreeWidgetItemPrivate `[friend]`

Search for all occurrences

Definition at line 69 of file qtreewidget.h.

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

- QtGui/qtreewidget.h

QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem
QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem QTreeWidgetItem