The pqFlatTreeView class is used to display a flattened tree view of a hierarchical model. More...
#include <pqFlatTreeView.h>
Public Types | |
enum | SelectionBehavior { SelectItems, SelectRows, SelectColumns } |
enum | SelectionMode { NoSelection, SingleSelection, ExtendedSelection } |
Public Slots | |
void | reset () |
void | selectAll () |
void | setCurrentIndex (const QModelIndex &index) |
void | expandAll () |
void | expand (const QModelIndex &index) |
void | collapse (const QModelIndex &index) |
void | scrollTo (const QModelIndex &index) |
Signals | |
void | activated (const QModelIndex &index) |
void | clicked (const QModelIndex &index) |
Public Member Functions | |
pqFlatTreeView (QWidget *parent=nullptr) | |
Creates a flat tree view. More... | |
~pqFlatTreeView () override | |
bool | eventFilter (QObject *object, QEvent *e) override |
Used to monitor the header view. More... | |
Model Setup Methods | |
QAbstractItemModel * | getModel () const |
void | setModel (QAbstractItemModel *model) |
QModelIndex | getRootIndex () const |
void | setRootIndex (const QModelIndex &index) |
Selection Setup Methods | |
QItemSelectionModel * | getSelectionModel () const |
void | setSelectionModel (QItemSelectionModel *selectionModel) |
SelectionBehavior | getSelectionBehavior () const |
void | setSelectionBehavior (SelectionBehavior behavior) |
SelectionMode | getSelectionMode () const |
void | setSelectionMode (SelectionMode mode) |
Column Management Methods | |
QHeaderView * | getHeader () const |
Gets whether or not the column size is managed by the view. More... | |
void | setHeader (QHeaderView *headerView) |
Gets whether or not the column size is managed by the view. More... | |
bool | isColumnSizeManaged () const |
Gets whether or not the column size is managed by the view. More... | |
void | setColumnSizeManaged (bool managed) |
Sets whether or not the column size is managed by the view. More... | |
Drawing Options | |
int | getIconSize () const |
void | setIconSize (int iconSize) |
Index Location Methods | |
bool | isIndexHidden (const QModelIndex &index) const |
void | getVisibleRect (const QModelIndex &index, QRect &area) const |
QModelIndex | getIndexVisibleAt (const QPoint &point) const |
QModelIndex | getIndexCellAt (const QPoint &point) const |
void | getSelectionIn (const QRect &rect, QItemSelection &items) const |
Index Navigation Methods | |
bool | isIndexExpanded (const QModelIndex &index) const |
QModelIndex | getNextVisibleIndex (const QModelIndex &index, const QModelIndex &root=QModelIndex()) const |
QModelIndex | getRelativeIndex (const QString &id, const QModelIndex &root=QModelIndex()) const |
void | getRelativeIndexId (const QModelIndex &index, QString &id, const QModelIndex &root=QModelIndex()) const |
Editing Methods | |
bool | startEditing (const QModelIndex &index) |
void | finishEditing () |
void | cancelEditing () |
Protected Slots | |
Model Change Handlers | |
void | insertRows (const QModelIndex &parent, int start, int end) |
void | startRowRemoval (const QModelIndex &parent, int start, int end) |
void | finishRowRemoval (const QModelIndex &parent, int start, int end) |
void | insertColumns (const QModelIndex &parent, int start, int end) |
void | startColumnRemoval (const QModelIndex &parent, int start, int end) |
void | finishColumnRemoval (const QModelIndex &parent, int start, int end) |
void | updateData (const QModelIndex &topLeft, const QModelIndex &bottomRight) |
Protected Member Functions | |
int | horizontalOffset () const |
int | verticalOffset () const |
void | resizeEvent (QResizeEvent *e) override |
bool | viewportEvent (QEvent *e) override |
void | paintEvent (QPaintEvent *e) override |
QStyleOptionViewItem | getViewOptions () const |
Keyboard Event Handlers | |
void | keyPressEvent (QKeyEvent *e) override |
void | keyboardSearch (const QString &search) |
Mouse Event Handlers | |
void | mousePressEvent (QMouseEvent *e) override |
void | mouseMoveEvent (QMouseEvent *e) override |
void | mouseReleaseEvent (QMouseEvent *e) override |
void | mouseDoubleClickEvent (QMouseEvent *e) override |
Event Handlers | |
bool | event (QEvent *e) override |
The pqFlatTreeView class is used to display a flattened tree view of a hierarchical model.
The tree view is flattened by taking long indented chains of single items and lining them up vertically. If an item is the only descendant of its parent item, it is drawn directly below its parent. A vertical branch is drawn between the items to indicate relationship. If an item has more than one descendant, those items are indented from the parent. Normal tree view branches are drawn between the parent and child items to show the relationship.
Definition at line 46 of file pqFlatTreeView.h.
Enumerator | |
---|---|
SelectItems | |
SelectRows | |
SelectColumns |
Definition at line 51 of file pqFlatTreeView.h.
Enumerator | |
---|---|
NoSelection | |
SingleSelection | |
ExtendedSelection |
Definition at line 58 of file pqFlatTreeView.h.
pqFlatTreeView::pqFlatTreeView | ( | QWidget * | parent = nullptr | ) |
Creates a flat tree view.
parent | The parent widget for this instance. |
|
override |
|
override |
Used to monitor the header view.
When the header view is shown or hidden, the layout needs to be updated and repainted.
object | The object which will receive the event. |
e | The event to be sent. |
|
inline |
Definition at line 89 of file pqFlatTreeView.h.
void pqFlatTreeView::setModel | ( | QAbstractItemModel * | model | ) |
QModelIndex pqFlatTreeView::getRootIndex | ( | ) | const |
void pqFlatTreeView::setRootIndex | ( | const QModelIndex & | index | ) |
|
inline |
Definition at line 100 of file pqFlatTreeView.h.
void pqFlatTreeView::setSelectionModel | ( | QItemSelectionModel * | selectionModel | ) |
|
inline |
Definition at line 103 of file pqFlatTreeView.h.
void pqFlatTreeView::setSelectionBehavior | ( | SelectionBehavior | behavior | ) |
|
inline |
Definition at line 106 of file pqFlatTreeView.h.
void pqFlatTreeView::setSelectionMode | ( | SelectionMode | mode | ) |
|
inline |
Gets whether or not the column size is managed by the view.
Column size management is on by default and used when the view header is hidden. When size management is on, the columns will be resized to fit the model data in the column.
Definition at line 114 of file pqFlatTreeView.h.
void pqFlatTreeView::setHeader | ( | QHeaderView * | headerView | ) |
Gets whether or not the column size is managed by the view.
Column size management is on by default and used when the view header is hidden. When size management is on, the columns will be resized to fit the model data in the column.
|
inline |
Gets whether or not the column size is managed by the view.
Column size management is on by default and used when the view header is hidden. When size management is on, the columns will be resized to fit the model data in the column.
Definition at line 128 of file pqFlatTreeView.h.
void pqFlatTreeView::setColumnSizeManaged | ( | bool | managed | ) |
Sets whether or not the column size is managed by the view.
managed | True if the column size should be managed. |
int pqFlatTreeView::getIconSize | ( | ) | const |
void pqFlatTreeView::setIconSize | ( | int | iconSize | ) |
bool pqFlatTreeView::isIndexHidden | ( | const QModelIndex & | index | ) | const |
void pqFlatTreeView::getVisibleRect | ( | const QModelIndex & | index, |
QRect & | area | ||
) | const |
QModelIndex pqFlatTreeView::getIndexVisibleAt | ( | const QPoint & | point | ) | const |
QModelIndex pqFlatTreeView::getIndexCellAt | ( | const QPoint & | point | ) | const |
void pqFlatTreeView::getSelectionIn | ( | const QRect & | rect, |
QItemSelection & | items | ||
) | const |
bool pqFlatTreeView::isIndexExpanded | ( | const QModelIndex & | index | ) | const |
QModelIndex pqFlatTreeView::getNextVisibleIndex | ( | const QModelIndex & | index, |
const QModelIndex & | root = QModelIndex() |
||
) | const |
QModelIndex pqFlatTreeView::getRelativeIndex | ( | const QString & | id, |
const QModelIndex & | root = QModelIndex() |
||
) | const |
void pqFlatTreeView::getRelativeIndexId | ( | const QModelIndex & | index, |
QString & | id, | ||
const QModelIndex & | root = QModelIndex() |
||
) | const |
bool pqFlatTreeView::startEditing | ( | const QModelIndex & | index | ) |
void pqFlatTreeView::finishEditing | ( | ) |
void pqFlatTreeView::cancelEditing | ( | ) |
|
signal |
|
signal |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
protectedslot |
|
overrideprotected |
|
protected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
protected |
|
protected |
|
overrideprotected |
|
overrideprotected |
|
overrideprotected |
|
protected |