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

- Class List
- Class Hierarchy
- Class Members

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

# QTreeView Class Reference

Search for all occurrences

## Detailed Description

Definition at line 58 of file qtreeview.h.

`#include <qtreeview.h>`

Inheritance diagram for QTreeView:
[legend]

List of all members.

## Public Slots
void | hideColumn (int column)
void | showColumn (int column)
void | expand (const QModelIndex &index)
void | collapse (const QModelIndex &index)
void | resizeColumnToContents (int column)
void | sortByColumn (int column)
void | expandAll ()
void | collapseAll ()
void | expandToDepth (int depth)
## Signals
void | expanded (const QModelIndex &index)
void | collapsed (const QModelIndex &index)
## Public Member Functions
| QTreeView (QWidget *parent=0)
| ~QTreeView ()
void | setModel (QAbstractItemModel *model)
void | setRootIndex (const QModelIndex &index)
void | setSelectionModel (QItemSelectionModel *selectionModel)
QHeaderView * | header () const
void | setHeader (QHeaderView *header)
int | autoExpandDelay () const
void | setAutoExpandDelay (int delay)
int | indentation () const
void | setIndentation (int i)
bool | rootIsDecorated () const
void | setRootIsDecorated (bool show)
bool | uniformRowHeights () const
void | setUniformRowHeights (bool uniform)
bool | itemsExpandable () const
void | setItemsExpandable (bool enable)
bool | expandsOnDoubleClick () const
void | setExpandsOnDoubleClick (bool enable)
int | columnViewportPosition (int column) const
int | columnWidth (int column) const
void | setColumnWidth (int column, int width)
int | columnAt (int x) const
bool | isColumnHidden (int column) const
void | setColumnHidden (int column, bool hide)
bool | isHeaderHidden () const
void | setHeaderHidden (bool hide)
bool | isRowHidden (int row, const QModelIndex &parent) const
void | setRowHidden (int row, const QModelIndex &parent, bool hide)
bool | isFirstColumnSpanned (int row, const QModelIndex &parent) const
void | setFirstColumnSpanned (int row, const QModelIndex &parent, bool span)
bool | isExpanded (const QModelIndex &index) const
void | setExpanded (const QModelIndex &index, bool expand)
void | setSortingEnabled (bool enable)
bool | isSortingEnabled () const
void | setAnimated (bool enable)
bool | isAnimated () const
void | setAllColumnsShowFocus (bool enable)
bool | allColumnsShowFocus () const
void | setWordWrap (bool on)
bool | wordWrap () const
void | keyboardSearch (const QString &search)
QRect | visualRect (const QModelIndex &index) const
void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible)
QModelIndex | indexAt (const QPoint &p) const
QModelIndex | indexAbove (const QModelIndex &index) const
QModelIndex | indexBelow (const QModelIndex &index) const
void | doItemsLayout ()
void | reset ()
void | sortByColumn (int column, Qt::SortOrder order)
void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
void | selectAll ()
## Protected Slots
void | columnResized (int column, int oldSize, int newSize)
void | columnCountChanged (int oldCount, int newCount)
void | columnMoved ()
void | reexpand ()
void | rowsRemoved (const QModelIndex &parent, int first, int last)
## Protected Member Functions
| QTreeView (QTreeViewPrivate &dd, QWidget *parent=0)
void | scrollContentsBy (int dx, int dy)
void | rowsInserted (const QModelIndex &parent, int start, int end)
void | rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers)
int | horizontalOffset () const
int | verticalOffset () const
void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags command)
QRegion | visualRegionForSelection (const QItemSelection &selection) const
QModelIndexList | selectedIndexes () const
void | timerEvent (QTimerEvent *event)
void | paintEvent (QPaintEvent *event)
void | drawTree (QPainter *painter, const QRegion &region) const
virtual void | drawRow (QPainter *painter, const QStyleOptionViewItem &options, const QModelIndex &index) const
virtual void | drawBranches (QPainter *painter, const QRect &rect, const QModelIndex &index) const
void | mousePressEvent (QMouseEvent *event)
void | mouseReleaseEvent (QMouseEvent *event)
void | mouseDoubleClickEvent (QMouseEvent *event)
void | mouseMoveEvent (QMouseEvent *event)
void | keyPressEvent (QKeyEvent *event)
void | dragMoveEvent (QDragMoveEvent *event)
bool | viewportEvent (QEvent *event)
void | updateGeometries ()
int | sizeHintForColumn (int column) const
int | indexRowSizeHint (const QModelIndex &index) const
int | rowHeight (const QModelIndex &index) const
void | horizontalScrollbarAction (int action)
bool | isIndexHidden (const QModelIndex &index) const
void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
void | currentChanged (const QModelIndex &current, const QModelIndex &previous)
## Properties
int | autoExpandDelay
int | indentation
bool | rootIsDecorated
bool | uniformRowHeights
bool | itemsExpandable
bool | sortingEnabled
bool | animated
bool | allColumnsShowFocus
bool | wordWrap
bool | headerHidden
bool | expandsOnDoubleClick
## Friends
class | QAccessibleItemView

## Constructor & Destructor Documentation

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

~QTreeView | ( |  | ) |

QTreeView | ( | QTreeViewPrivate & | dd,
|  | QWidget * | parent = `0`
| ) |  | `[protected]`

## Member Function Documentation

void setModel | ( | QAbstractItemModel * | model | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void setRootIndex | ( | const QModelIndex & | index | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

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

Search for all occurrences

Reimplemented from QAbstractItemView.

Reimplemented in QTreeWidget.

QHeaderView* header | ( |  | ) | const

Search for all occurrences

void setHeader | ( | QHeaderView * | header | ) |

Search for all occurrences

int autoExpandDelay | ( |  | ) | const

Search for all occurrences

void setAutoExpandDelay | ( | int | delay | ) |

Search for all occurrences

int indentation | ( |  | ) | const

Search for all occurrences

void setIndentation | ( | int | i | ) |

Search for all occurrences

bool rootIsDecorated | ( |  | ) | const

Search for all occurrences

void setRootIsDecorated | ( | bool | show | ) |

Search for all occurrences

bool uniformRowHeights | ( |  | ) | const

Search for all occurrences

void setUniformRowHeights | ( | bool | uniform | ) |

Search for all occurrences

bool itemsExpandable | ( |  | ) | const

Search for all occurrences

void setItemsExpandable | ( | bool | enable | ) |

Search for all occurrences

bool expandsOnDoubleClick | ( |  | ) | const

Search for all occurrences

void setExpandsOnDoubleClick | ( | bool | enable | ) |

Search for all occurrences

int columnViewportPosition | ( | int | column | ) | const

Search for all occurrences

int columnWidth | ( | int | column | ) | const

Search for all occurrences

void setColumnWidth | ( | int | column,
|  | int | width
| ) |  |

Search for all occurrences

int columnAt | ( | int | x | ) | const

Search for all occurrences

bool isColumnHidden | ( | int | column | ) | const

Search for all occurrences

void setColumnHidden | ( | int | column,
|  | bool | hide
| ) |  |

Search for all occurrences

bool isHeaderHidden | ( |  | ) | const

Search for all occurrences

void setHeaderHidden | ( | bool | hide | ) |

Search for all occurrences

bool isRowHidden | ( | int | row,
|  | const QModelIndex & | parent
| ) |  | const

Search for all occurrences

void setRowHidden | ( | int | row,
|  | const QModelIndex & | parent,
|  | bool | hide
| ) |  |

Search for all occurrences

bool isFirstColumnSpanned | ( | int | row,
|  | const QModelIndex & | parent
| ) |  | const

Search for all occurrences

void setFirstColumnSpanned | ( | int | row,
|  | const QModelIndex & | parent,
|  | bool | span
| ) |  |

Search for all occurrences

bool isExpanded | ( | const QModelIndex & | index | ) | const

Search for all occurrences

void setExpanded | ( | const QModelIndex & | index,
|  | bool | expand
| ) |  |

Search for all occurrences

void setSortingEnabled | ( | bool | enable | ) |

Search for all occurrences

Reimplemented in QTreeWidget.

bool isSortingEnabled | ( |  | ) | const

Search for all occurrences

Reimplemented in QTreeWidget.

void setAnimated | ( | bool | enable | ) |

Search for all occurrences

bool isAnimated | ( |  | ) | const

Search for all occurrences

void setAllColumnsShowFocus | ( | bool | enable | ) |

Search for all occurrences

bool allColumnsShowFocus | ( |  | ) | const

Search for all occurrences

void setWordWrap | ( | bool | on | ) |

Search for all occurrences

bool wordWrap | ( |  | ) | const

Search for all occurrences

void keyboardSearch | ( | const QString & | search | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

QRect visualRect | ( | const QModelIndex & | index | ) | const `[virtual]`

Search for all occurrences

Implements QAbstractItemView.

void scrollTo | ( | const QModelIndex & | index,
|  | ScrollHint | hint = `EnsureVisible`
| ) |  | `[virtual]`

Search for all occurrences

Implements QAbstractItemView.

QModelIndex indexAt | ( | const QPoint & | p | ) | const `[virtual]`

Search for all occurrences

Implements QAbstractItemView.

QModelIndex indexAbove | ( | const QModelIndex & | index | ) | const

Search for all occurrences

QModelIndex indexBelow | ( | const QModelIndex & | index | ) | const

Search for all occurrences

void doItemsLayout | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void reset | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

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

Search for all occurrences

void dataChanged | ( | const QModelIndex & | topLeft,
|  | const QModelIndex & | bottomRight
| ) |  | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void selectAll | ( |  | ) | `[virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void expanded | ( | const QModelIndex & | index | ) | `[signal]`

Search for all occurrences

void collapsed | ( | const QModelIndex & | index | ) | `[signal]`

Search for all occurrences

void hideColumn | ( | int | column | ) | `[slot]`

Search for all occurrences

void showColumn | ( | int | column | ) | `[slot]`

Search for all occurrences

void expand | ( | const QModelIndex & | index | ) | `[slot]`

Search for all occurrences

void collapse | ( | const QModelIndex & | index | ) | `[slot]`

Search for all occurrences

void resizeColumnToContents | ( | int | column | ) | `[slot]`

Search for all occurrences

void sortByColumn | ( | int | column | ) | `[slot]`

Search for all occurrences

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

Search for all occurrences

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

Search for all occurrences

void expandToDepth | ( | int | depth | ) | `[slot]`

Search for all occurrences

void columnResized | ( | int | column,
|  | int | oldSize,
|  | int | newSize
| ) |  | `[protected, slot]`

Search for all occurrences

void columnCountChanged | ( | int | oldCount,
|  | int | newCount
| ) |  | `[protected, slot]`

Search for all occurrences

void columnMoved | ( |  | ) | `[protected, slot]`

Search for all occurrences

void reexpand | ( |  | ) | `[protected, slot]`

Search for all occurrences

void rowsRemoved | ( | const QModelIndex & | parent,
|  | int | first,
|  | int | last
| ) |  | `[protected, slot]`

Search for all occurrences

void scrollContentsBy | ( | int | dx,
|  | int | dy
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

void rowsInserted | ( | const QModelIndex & | parent,
|  | int | start,
|  | int | end
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void rowsAboutToBeRemoved | ( | const QModelIndex & | parent,
|  | int | start,
|  | int | end
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

QModelIndex moveCursor | ( | CursorAction | cursorAction,
|  | Qt::KeyboardModifiers | modifiers
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

int horizontalOffset | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

int verticalOffset | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

void setSelection | ( | const QRect & | rect,
|  | QItemSelectionModel::SelectionFlags | command
| ) |  | `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

QRegion visualRegionForSelection | ( | const QItemSelection & | selection | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

QModelIndexList selectedIndexes | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void timerEvent | ( | QTimerEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void paintEvent | ( | QPaintEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractScrollArea.

void drawTree | ( | QPainter * | painter,
|  | const QRegion & | region
| ) |  | const `[protected]`

Search for all occurrences

virtual void drawRow | ( | QPainter * | painter,
|  | const QStyleOptionViewItem & | options,
|  | const QModelIndex & | index
| ) |  | const `[protected, virtual]`

Search for all occurrences

virtual void drawBranches | ( | QPainter * | painter,
|  | const QRect & | rect,
|  | const QModelIndex & | index
| ) |  | const `[protected, virtual]`

Search for all occurrences

void mousePressEvent | ( | QMouseEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void mouseReleaseEvent | ( | QMouseEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void mouseDoubleClickEvent | ( | QMouseEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void mouseMoveEvent | ( | QMouseEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void keyPressEvent | ( | QKeyEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void dragMoveEvent | ( | QDragMoveEvent * | event | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

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

Search for all occurrences

Reimplemented from QAbstractItemView.

void updateGeometries | ( |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

int sizeHintForColumn | ( | int | column | ) | const `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

int indexRowSizeHint | ( | const QModelIndex & | index | ) | const `[protected]`

Search for all occurrences

int rowHeight | ( | const QModelIndex & | index | ) | const `[protected]`

Search for all occurrences

void horizontalScrollbarAction | ( | int | action | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

bool isIndexHidden | ( | const QModelIndex & | index | ) | const `[protected, virtual]`

Search for all occurrences

Implements QAbstractItemView.

void selectionChanged | ( | const QItemSelection & | selected,
|  | const QItemSelection & | deselected
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

void currentChanged | ( | const QModelIndex & | current,
|  | const QModelIndex & | previous
| ) |  | `[protected, virtual]`

Search for all occurrences

Reimplemented from QAbstractItemView.

## Friends And Related Function Documentation

friend class QAccessibleItemView `[friend]`

Search for all occurrences

Definition at line 221 of file qtreeview.h.

## Property Documentation

int autoExpandDelay `[read, write]`

Search for all occurrences

Definition at line 61 of file qtreeview.h.

int indentation `[read, write]`

Search for all occurrences

Definition at line 62 of file qtreeview.h.

bool rootIsDecorated `[read, write]`

Search for all occurrences

Definition at line 63 of file qtreeview.h.

bool uniformRowHeights `[read, write]`

Search for all occurrences

Definition at line 64 of file qtreeview.h.

bool itemsExpandable `[read, write]`

Search for all occurrences

Definition at line 65 of file qtreeview.h.

bool sortingEnabled `[read, write]`

Search for all occurrences

Definition at line 66 of file qtreeview.h.

bool animated `[read, write]`

Search for all occurrences

Definition at line 67 of file qtreeview.h.

bool allColumnsShowFocus `[read, write]`

Search for all occurrences

Definition at line 68 of file qtreeview.h.

bool wordWrap `[read, write]`

Search for all occurrences

Definition at line 69 of file qtreeview.h.

bool headerHidden `[read, write]`

Search for all occurrences

Definition at line 70 of file qtreeview.h.

bool expandsOnDoubleClick `[read, write]`

Search for all occurrences

Definition at line 71 of file qtreeview.h.

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

- QtGui/qtreeview.h

QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView
QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView QTreeView