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

- Class List
- Class Hierarchy
- Class Members

Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends

# QTreeWidget Class Reference

Search for all occurrences

## Detailed Description

Definition at line 260 of file qtreewidget.h.

`#include <qtreewidget.h>`

Inheritance diagram for QTreeWidget:
[legend]

List of all members.

## Public Slots
void | scrollToItem (const QTreeWidgetItem *item, QAbstractItemView::ScrollHint hint=EnsureVisible)
void | expandItem (const QTreeWidgetItem *item)
void | collapseItem (const QTreeWidgetItem *item)
void | clear ()
## Signals
void | itemPressed (QTreeWidgetItem *item, int column)
void | itemClicked (QTreeWidgetItem *item, int column)
void | itemDoubleClicked (QTreeWidgetItem *item, int column)
void | itemActivated (QTreeWidgetItem *item, int column)
void | itemEntered (QTreeWidgetItem *item, int column)
void | itemChanged (QTreeWidgetItem *item, int column)
void | itemExpanded (QTreeWidgetItem *item)
void | itemCollapsed (QTreeWidgetItem *item)
void | currentItemChanged (QTreeWidgetItem *current, QTreeWidgetItem *previous)
void | itemSelectionChanged ()
## Public Member Functions
| QTreeWidget (QWidget *parent=0)
| ~QTreeWidget ()
int | columnCount () const
void | setColumnCount (int columns)
QTreeWidgetItem * | invisibleRootItem () const
QTreeWidgetItem * | topLevelItem (int index) const
int | topLevelItemCount () const
void | insertTopLevelItem (int index, QTreeWidgetItem *item)
void | addTopLevelItem (QTreeWidgetItem *item)
QTreeWidgetItem * | takeTopLevelItem (int index)
int | indexOfTopLevelItem (QTreeWidgetItem *item)
int | indexOfTopLevelItem (QTreeWidgetItem *item) const
void | insertTopLevelItems (int index, const QList< QTreeWidgetItem * > &items)
void | addTopLevelItems (const QList< QTreeWidgetItem * > &items)
QTreeWidgetItem * | headerItem () const
void | setHeaderItem (QTreeWidgetItem *item)
void | setHeaderLabels (const QStringList &labels)
void | setHeaderLabel (const QString &label)
QTreeWidgetItem * | currentItem () const
int | currentColumn () const
void | setCurrentItem (QTreeWidgetItem *item)
void | setCurrentItem (QTreeWidgetItem *item, int column)
void | setCurrentItem (QTreeWidgetItem *item, int column, QItemSelectionModel::SelectionFlags command)
QTreeWidgetItem * | itemAt (const QPoint &p) const
QTreeWidgetItem * | itemAt (int x, int y) const
QRect | visualItemRect (const QTreeWidgetItem *item) const
int | sortColumn () const
void | sortItems (int column, Qt::SortOrder order)
void | setSortingEnabled (bool enable)
bool | isSortingEnabled () const
void | editItem (QTreeWidgetItem *item, int column=0)
void | openPersistentEditor (QTreeWidgetItem *item, int column=0)
void | closePersistentEditor (QTreeWidgetItem *item, int column=0)
QWidget * | itemWidget (QTreeWidgetItem *item, int column) const
void | setItemWidget (QTreeWidgetItem *item, int column, QWidget *widget)
void | removeItemWidget (QTreeWidgetItem *item, int column)
bool | isItemSelected (const QTreeWidgetItem *item) const
void | setItemSelected (const QTreeWidgetItem *item, bool select)
QList< QTreeWidgetItem * > | selectedItems () const
QList< QTreeWidgetItem * > | findItems (const QString &text, Qt::MatchFlags flags, int column=0) const
bool | isItemHidden (const QTreeWidgetItem *item) const
void | setItemHidden (const QTreeWidgetItem *item, bool hide)
bool | isItemExpanded (const QTreeWidgetItem *item) const
void | setItemExpanded (const QTreeWidgetItem *item, bool expand)
bool | isFirstItemColumnSpanned (const QTreeWidgetItem *item) const
void | setFirstItemColumnSpanned (const QTreeWidgetItem *item, bool span)
QTreeWidgetItem * | itemAbove (const QTreeWidgetItem *item) const
QTreeWidgetItem * | itemBelow (const QTreeWidgetItem *item) const
void | setSelectionModel (QItemSelectionModel *selectionModel)
## Protected Member Functions
bool | event (QEvent *e)
virtual QStringList | mimeTypes () const
virtual QMimeData * | mimeData (const QList< QTreeWidgetItem * > items) const
virtual bool | dropMimeData (QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action)
virtual Qt::DropActions | supportedDropActions () const
QList< QTreeWidgetItem * > | items (const QMimeData *data) const
QModelIndex | indexFromItem (QTreeWidgetItem *item, int column=0) const
QTreeWidgetItem * | itemFromIndex (const QModelIndex &index) const
void | dropEvent (QDropEvent *event)
## Properties
int | columnCount
int | topLevelItemCount
## Friends
class | QTreeModel
class | QTreeWidgetItem

## Constructor & Destructor Documentation

QTreeWidget | ( | QWidget * | parent = `0` | ) | `[explicit]`

~QTreeWidget | ( |  | ) |

## Member Function Documentation

int columnCount | ( |  | ) | const

Search for all occurrences

void setColumnCount | ( | int | columns | ) |

Search for all occurrences

QTreeWidgetItem* invisibleRootItem | ( |  | ) | const

Search for all occurrences

QTreeWidgetItem* topLevelItem | ( | int | index | ) | const

Search for all occurrences

int topLevelItemCount | ( |  | ) | const

Search for all occurrences

void insertTopLevelItem | ( | int | index,
|  | QTreeWidgetItem * | item
| ) |  |

Search for all occurrences

void addTopLevelItem | ( | QTreeWidgetItem * | item | ) |

Search for all occurrences

QTreeWidgetItem* takeTopLevelItem | ( | int | index | ) |

Search for all occurrences

int indexOfTopLevelItem | ( | QTreeWidgetItem * | item | ) |

Search for all occurrences

int indexOfTopLevelItem | ( | QTreeWidgetItem * | item | ) | const

Search for all occurrences

void insertTopLevelItems | ( | int | index,
|  | const QList< QTreeWidgetItem * > & | items
| ) |  |

Search for all occurrences

void addTopLevelItems | ( | const QList< QTreeWidgetItem * > & | items | ) |

Search for all occurrences

QTreeWidgetItem* headerItem | ( |  | ) | const

Search for all occurrences

void setHeaderItem | ( | QTreeWidgetItem * | item | ) |

Search for all occurrences

void setHeaderLabels | ( | const QStringList & | labels | ) |

Search for all occurrences

void setHeaderLabel | ( | const QString & | label | ) | `[inline]`

Search for all occurrences

Definition at line 393 of file qtreewidget.h.

    { setHeaderLabels(QStringList(alabel)); }

QTreeWidgetItem* currentItem | ( |  | ) | const

Search for all occurrences

int currentColumn | ( |  | ) | const

Search for all occurrences

void setCurrentItem | ( | QTreeWidgetItem * | item | ) |

Search for all occurrences

void setCurrentItem | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  |

Search for all occurrences

void setCurrentItem | ( | QTreeWidgetItem * | item,
|  | int | column,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  |

Search for all occurrences

QTreeWidgetItem* itemAt | ( | const QPoint & | p | ) | const

Search for all occurrences

QTreeWidgetItem * itemAt | ( | int | x,
|  | int | y
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 390 of file qtreewidget.h.

    { return itemAt(QPoint(ax, ay)); }

QRect visualItemRect | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

int sortColumn | ( |  | ) | const

Search for all occurrences

void sortItems | ( | int | column,
|  | Qt::SortOrder | order
| ) |  |

Search for all occurrences

void setSortingEnabled | ( | bool | enable | ) |

Search for all occurrences

Reimplemented from QTreeView.

bool isSortingEnabled | ( |  | ) | const

Search for all occurrences

Reimplemented from QTreeView.

void editItem | ( | QTreeWidgetItem * | item,
|  | int | column = `0`
| ) |  |

Search for all occurrences

void openPersistentEditor | ( | QTreeWidgetItem * | item,
|  | int | column = `0`
| ) |  |

Search for all occurrences

void closePersistentEditor | ( | QTreeWidgetItem * | item,
|  | int | column = `0`
| ) |  |

Search for all occurrences

QWidget* itemWidget | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | const

Search for all occurrences

void setItemWidget | ( | QTreeWidgetItem * | item,
|  | int | column,
|  | QWidget * | widget
| ) |  |

Search for all occurrences

void removeItemWidget | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[inline]`

Search for all occurrences

Definition at line 387 of file qtreewidget.h.

    { setItemWidget(item, column, 0); }

bool isItemSelected | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

void setItemSelected | ( | const QTreeWidgetItem * | item,
|  | bool | select
| ) |  |

Search for all occurrences

QList<QTreeWidgetItem*> selectedItems | ( |  | ) | const

Search for all occurrences

QList<QTreeWidgetItem*> findItems | ( | const QString & | text,
|  | Qt::MatchFlags | flags,
|  | int | column = `0`
| ) |  | const

Search for all occurrences

bool isItemHidden | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

void setItemHidden | ( | const QTreeWidgetItem * | item,
|  | bool | hide
| ) |  |

Search for all occurrences

bool isItemExpanded | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

void setItemExpanded | ( | const QTreeWidgetItem * | item,
|  | bool | expand
| ) |  |

Search for all occurrences

bool isFirstItemColumnSpanned | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

void setFirstItemColumnSpanned | ( | const QTreeWidgetItem * | item,
|  | bool | span
| ) |  |

Search for all occurrences

QTreeWidgetItem* itemAbove | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

QTreeWidgetItem* itemBelow | ( | const QTreeWidgetItem * | item | ) | const

Search for all occurrences

void setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) | `[virtual]`

Search for all occurrences

Reimplemented from QTreeView.

void scrollToItem | ( | const QTreeWidgetItem * | item,
|  | QAbstractItemView::ScrollHint | hint = `EnsureVisible`
| ) |  | `[slot]`

Search for all occurrences

void expandItem | ( | const QTreeWidgetItem * | item | ) | `[slot]`

Search for all occurrences

void collapseItem | ( | const QTreeWidgetItem * | item | ) | `[slot]`

Search for all occurrences

void clear | ( |  | ) | `[slot]`

Search for all occurrences

void itemPressed | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void itemClicked | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void itemDoubleClicked | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void itemActivated | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void itemEntered | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void itemChanged | ( | QTreeWidgetItem * | item,
|  | int | column
| ) |  | `[signal]`

Search for all occurrences

void itemExpanded | ( | QTreeWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void itemCollapsed | ( | QTreeWidgetItem * | item | ) | `[signal]`

Search for all occurrences

void currentItemChanged | ( | QTreeWidgetItem * | current,
|  | QTreeWidgetItem * | previous
| ) |  | `[signal]`

Search for all occurrences

void itemSelectionChanged | ( |  | ) | `[signal]`

Search for all occurrences

bool event | ( | QEvent * | e | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

virtual QStringList mimeTypes | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

virtual QMimeData* mimeData | ( | const QList< QTreeWidgetItem * > | items | ) | const `[protected, virtual]`

Search for all occurrences

virtual bool dropMimeData | ( | QTreeWidgetItem * | parent,
|  | int | index,
|  | const QMimeData * | data,
|  | Qt::DropAction | action
| ) |  | `[protected, virtual]`

Search for all occurrences

virtual Qt::DropActions supportedDropActions | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

QList<QTreeWidgetItem*> items | ( | const QMimeData * | data | ) | const `[protected]`

Search for all occurrences

QModelIndex indexFromItem | ( | QTreeWidgetItem * | item,
|  | int | column = `0`
| ) |  | const `[protected]`

Search for all occurrences

QTreeWidgetItem* itemFromIndex | ( | const QModelIndex & | index | ) | const `[protected]`

Search for all occurrences

void dropEvent | ( | QDropEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

## Friends And Related Function Documentation

friend class QTreeModel `[friend]`

Search for all occurrences

Definition at line 266 of file qtreewidget.h.

friend class QTreeWidgetItem `[friend]`

Search for all occurrences

Definition at line 267 of file qtreewidget.h.

## Property Documentation

int columnCount `[read, write]`

Search for all occurrences

Definition at line 263 of file qtreewidget.h.

int topLevelItemCount `[read]`

Search for all occurrences

Definition at line 264 of file qtreewidget.h.

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

- QtGui/qtreewidget.h

QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget
QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget QTreeWidget