ParaView
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions
pqFlatTreeView Class Reference

The pqFlatTreeView class is used to display a flattened tree view of a hierarchical model. More...

#include <pqFlatTreeView.h>

Inheritance diagram for pqFlatTreeView:
Inheritance graph
[legend]

List of all members.

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=0)
 Creates a flat tree view.
virtual ~pqFlatTreeView ()
virtual bool eventFilter (QObject *object, QEvent *e)
 Used to monitor the header view.
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.
void setHeader (QHeaderView *headerView)
 Gets whether or not the column size is managed by the view.
bool isColumnSizeManaged () const
 Gets whether or not the column size is managed by the view.
void setColumnSizeManaged (bool managed)
 Sets whether or not the column size is managed by the view.
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
virtual void resizeEvent (QResizeEvent *e)
virtual bool viewportEvent (QEvent *e)
virtual void paintEvent (QPaintEvent *e)
QStyleOptionViewItem getViewOptions () const
Keyboard Event Handlers
virtual void keyPressEvent (QKeyEvent *e)
void keyboardSearch (const QString &search)
Mouse Event Handlers
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
virtual void mouseDoubleClickEvent (QMouseEvent *e)
virtual void wheelEvent (QWheelEvent *e)
Event Handlers
virtual bool event (QEvent *e)

Detailed Description

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 descendent 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 descendent, 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 72 of file pqFlatTreeView.h.


Member Enumeration Documentation

Enumerator:
SelectItems 
SelectRows 
SelectColumns 

Definition at line 77 of file pqFlatTreeView.h.

Enumerator:
NoSelection 
SingleSelection 
ExtendedSelection 

Definition at line 84 of file pqFlatTreeView.h.


Constructor & Destructor Documentation

pqFlatTreeView::pqFlatTreeView ( QWidget *  parent = 0)

Creates a flat tree view.

Parameters:
parentThe parent widget for this instance.
virtual pqFlatTreeView::~pqFlatTreeView ( ) [virtual]

Member Function Documentation

virtual bool pqFlatTreeView::eventFilter ( QObject *  object,
QEvent *  e 
) [virtual]

Used to monitor the header view.

When the header view is shown or hidden, the layout needs to be updated and repainted.

Parameters:
objectThe object which will receive the event.
eThe event to be sent.

Reimplemented in pqPipelineBrowserWidget.

QAbstractItemModel* pqFlatTreeView::getModel ( ) const [inline]

Definition at line 110 of file pqFlatTreeView.h.

void pqFlatTreeView::setModel ( QAbstractItemModel *  model)
QModelIndex pqFlatTreeView::getRootIndex ( ) const
void pqFlatTreeView::setRootIndex ( const QModelIndex &  index)
QItemSelectionModel* pqFlatTreeView::getSelectionModel ( ) const [inline]

Definition at line 119 of file pqFlatTreeView.h.

void pqFlatTreeView::setSelectionModel ( QItemSelectionModel *  selectionModel)
SelectionBehavior pqFlatTreeView::getSelectionBehavior ( ) const [inline]

Definition at line 122 of file pqFlatTreeView.h.

void pqFlatTreeView::setSelectionBehavior ( SelectionBehavior  behavior)
SelectionMode pqFlatTreeView::getSelectionMode ( ) const [inline]

Definition at line 125 of file pqFlatTreeView.h.

void pqFlatTreeView::setSelectionMode ( SelectionMode  mode)
QHeaderView* pqFlatTreeView::getHeader ( ) const [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.

Returns:
True if the column size is managed by the view.

Definition at line 131 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.

Returns:
True if the column size is managed by the view.
bool pqFlatTreeView::isColumnSizeManaged ( ) const [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.

Returns:
True if the column size is managed by the view.

Definition at line 143 of file pqFlatTreeView.h.

void pqFlatTreeView::setColumnSizeManaged ( bool  managed)

Sets whether or not the column size is managed by the view.

Parameters:
managedTrue if the column size should be managed.
See also:
pqFlatTreeView::isColumnSizeManaged()
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 ( )
void pqFlatTreeView::activated ( const QModelIndex &  index) [signal]
void pqFlatTreeView::clicked ( const QModelIndex &  index) [signal]
void pqFlatTreeView::reset ( ) [slot]
void pqFlatTreeView::selectAll ( ) [slot]
void pqFlatTreeView::setCurrentIndex ( const QModelIndex &  index) [slot]
void pqFlatTreeView::expandAll ( ) [slot]
void pqFlatTreeView::expand ( const QModelIndex &  index) [slot]
void pqFlatTreeView::collapse ( const QModelIndex &  index) [slot]
void pqFlatTreeView::scrollTo ( const QModelIndex &  index) [slot]
void pqFlatTreeView::insertRows ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]
void pqFlatTreeView::startRowRemoval ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]
void pqFlatTreeView::finishRowRemoval ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]
void pqFlatTreeView::insertColumns ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]
void pqFlatTreeView::startColumnRemoval ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]
void pqFlatTreeView::finishColumnRemoval ( const QModelIndex &  parent,
int  start,
int  end 
) [protected, slot]
void pqFlatTreeView::updateData ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
) [protected, slot]
virtual void pqFlatTreeView::keyPressEvent ( QKeyEvent *  e) [protected, virtual]
void pqFlatTreeView::keyboardSearch ( const QString &  search) [protected]
virtual void pqFlatTreeView::mousePressEvent ( QMouseEvent *  e) [protected, virtual]
virtual void pqFlatTreeView::mouseMoveEvent ( QMouseEvent *  e) [protected, virtual]
virtual void pqFlatTreeView::mouseReleaseEvent ( QMouseEvent *  e) [protected, virtual]
virtual void pqFlatTreeView::mouseDoubleClickEvent ( QMouseEvent *  e) [protected, virtual]
virtual void pqFlatTreeView::wheelEvent ( QWheelEvent *  e) [protected, virtual]
virtual bool pqFlatTreeView::event ( QEvent *  e) [protected, virtual]
int pqFlatTreeView::horizontalOffset ( ) const [protected]
int pqFlatTreeView::verticalOffset ( ) const [protected]
virtual void pqFlatTreeView::resizeEvent ( QResizeEvent *  e) [protected, virtual]
virtual bool pqFlatTreeView::viewportEvent ( QEvent *  e) [protected, virtual]
virtual void pqFlatTreeView::paintEvent ( QPaintEvent *  e) [protected, virtual]
QStyleOptionViewItem pqFlatTreeView::getViewOptions ( ) const [protected]

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