ManiVault 1.0.0
A Flexible and Extensible Visual Analytics Framework for High-Dimensional Data
Loading...
Searching...
No Matches
hdps::gui::HierarchyWidget Class Reference

#include <HierarchyWidget.h>

Inheritance diagram for hdps::gui::HierarchyWidget:

Public Member Functions

 HierarchyWidget (QWidget *parent, const QString &itemTypeName, const QAbstractItemModel &model, QSortFilterProxyModel *filterModel=nullptr, bool showToolbar=true, bool showOverlay=true)
 
QString getItemTypeName () const
 
void setItemTypeName (const QString &itemTypeName)
 
void setWindowIcon (const QIcon &icon)
 
void setNoItemsDescription (const QString &noItemsDescription)
 
bool getHeaderHidden () const
 
void setHeaderHidden (bool headerHidden)
 
const QAbstractItemModel & getModel ()
 
QSortFilterProxyModel * getFilterModel ()
 
QItemSelectionModel & getSelectionModel ()
 
HierarchyWidgetTreeViewgetTreeView ()
 
InfoOverlayWidgetgetInfoOverlayWidget ()
 
StringActiongetFilterNameAction ()
 
OptionActiongetFilterColumnAction ()
 
GroupActiongetFilterGroupAction ()
 
ToggleActiongetFilterRegularExpressionAction ()
 
ToggleActiongetFilterCaseSensitiveAction ()
 
TriggerActiongetExpandAllAction ()
 
TriggerActiongetCollapseAllAction ()
 
GroupActiongetSelectionGroupAction ()
 
GroupActiongetColumnsGroupAction ()
 
GroupActiongetSettingsGroupAction ()
 
QModelIndex toSourceModelIndex (const QModelIndex &modelIndex) const
 
QModelIndexList getSelectedRows () const
 
QModelIndexList fetchFilterModelIndices (QModelIndex filterModelIndex=QModelIndex()) const
 
HorizontalGroupActiongetToolbarAction ()
 

Protected Member Functions

bool mayExpandAll () const
 
void expandAll ()
 
bool mayCollapseAll () const
 
void collapseAll ()
 
bool maySelectAll () const
 
void selectAll ()
 
bool maySelectNone () const
 
void selectNone ()
 
void updateHeaderVisibility ()
 

Detailed Description

Base widget for displaying a hierarchical model in a tree view

It sets up the tree view and links up the filter and selection models.

Features a toolbar for interaction with the model built with actions:

  • Filter by name (possibly with regular expression)
  • Expanding all items
  • Collapsing all items
  • Selecting all items
  • De-selecting all items
  • Edit settings

In addition, it shows an overlay widget (with icon, title and description) when no items are loaded or filtering did not yield any items.

Author
Thomas Kroes

Constructor & Destructor Documentation

◆ HierarchyWidget()

hdps::gui::HierarchyWidget::HierarchyWidget ( QWidget *  parent,
const QString &  itemTypeName,
const QAbstractItemModel &  model,
QSortFilterProxyModel *  filterModel = nullptr,
bool  showToolbar = true,
bool  showOverlay = true 
)

Constructor

Parameters
parentParent widget
itemTypeNameType name of the item (e.g. dataset or action)
modelReference to input model
filterModelPointer to input filter model (if present)
showToolbarWhether to add a default toolbar for filtering and expand/collapse
showOverlayWhether to show an overlay when the (filter) model is empty

Member Function Documentation

◆ collapseAll()

void hdps::gui::HierarchyWidget::collapseAll ( )
protected

Collapse all items in the hierarchy

◆ expandAll()

void hdps::gui::HierarchyWidget::expandAll ( )
protected

Expand all items in the hierarchy

◆ fetchFilterModelIndices()

QModelIndexList hdps::gui::HierarchyWidget::fetchFilterModelIndices ( QModelIndex  filterModelIndex = QModelIndex()) const

Fetches filter model indices of filterModelIndex and its children recursively

Parameters
filterModelIndexFilter model index
Returns
Fetched filter model indices

◆ getCollapseAllAction()

TriggerAction & hdps::gui::HierarchyWidget::getCollapseAllAction ( )
inline

Get collapse all action

Returns
Reference to collapse all action

◆ getColumnsGroupAction()

GroupAction & hdps::gui::HierarchyWidget::getColumnsGroupAction ( )
inline

Get columns group action

Returns
Reference to columns group action

◆ getExpandAllAction()

TriggerAction & hdps::gui::HierarchyWidget::getExpandAllAction ( )
inline

Get expand all action

Returns
Reference to expand all action

◆ getFilterCaseSensitiveAction()

ToggleAction & hdps::gui::HierarchyWidget::getFilterCaseSensitiveAction ( )
inline

Get filter case sensitive action

Returns
Reference to filter case sensitive action

◆ getFilterColumnAction()

OptionAction & hdps::gui::HierarchyWidget::getFilterColumnAction ( )
inline

Get filter column action

Returns
Reference to filter column action

◆ getFilterGroupAction()

GroupAction & hdps::gui::HierarchyWidget::getFilterGroupAction ( )
inline

Get filter group action

Returns
Reference to filter group action

◆ getFilterModel()

QSortFilterProxyModel * hdps::gui::HierarchyWidget::getFilterModel ( )
inline

Set input model to model

Parameters
modelInput model Get input filter model
Returns
Pointer to input filter model

◆ getFilterNameAction()

StringAction & hdps::gui::HierarchyWidget::getFilterNameAction ( )
inline

Get filter name action

Returns
Reference to filter name action

◆ getFilterRegularExpressionAction()

ToggleAction & hdps::gui::HierarchyWidget::getFilterRegularExpressionAction ( )
inline

Get filter regular expression action

Returns
Reference to filter regular expression action

◆ getHeaderHidden()

bool hdps::gui::HierarchyWidget::getHeaderHidden ( ) const

Get whether the header view is visible or not

Returns
Boolean determining whether the header view is visible or not

◆ getInfoOverlayWidget()

InfoOverlayWidget * hdps::gui::HierarchyWidget::getInfoOverlayWidget ( )
inline

Get overlay widget

Returns
Pointer to overlay widget

◆ getItemTypeName()

QString hdps::gui::HierarchyWidget::getItemTypeName ( ) const

Get item type name

Returns
Item type name

◆ getModel()

const QAbstractItemModel & hdps::gui::HierarchyWidget::getModel ( )
inline

Get input model

Returns
Input model

◆ getSelectedRows()

QModelIndexList hdps::gui::HierarchyWidget::getSelectedRows ( ) const

Get selected rows

Returns
Model indices of the selected rows

◆ getSelectionGroupAction()

GroupAction & hdps::gui::HierarchyWidget::getSelectionGroupAction ( )
inline

Get selection group action

Returns
Reference to selection group action

◆ getSelectionModel()

QItemSelectionModel & hdps::gui::HierarchyWidget::getSelectionModel ( )
inline

Get selection model

Returns
Reference to selection model

◆ getSettingsGroupAction()

GroupAction & hdps::gui::HierarchyWidget::getSettingsGroupAction ( )
inline

Get selection group action

Returns
Reference to selection group

◆ getToolbarAction()

HorizontalGroupAction & hdps::gui::HierarchyWidget::getToolbarAction ( )
inline

◆ getTreeView()

HierarchyWidgetTreeView & hdps::gui::HierarchyWidget::getTreeView ( )
inline

Get tree view widget

Returns
Reference to tree view widget

◆ mayCollapseAll()

bool hdps::gui::HierarchyWidget::mayCollapseAll ( ) const
protected

Get whether one or more items may be collapse

Returns
Boolean indicating whether one or more items may be collapse

◆ mayExpandAll()

bool hdps::gui::HierarchyWidget::mayExpandAll ( ) const
protected

Get whether one or more items may be expanded

Returns
Boolean indicating whether one or more items may be expanded

◆ maySelectAll()

bool hdps::gui::HierarchyWidget::maySelectAll ( ) const
protected

Get whether all items may be selected

Returns
Boolean determining whether all items may be selected

◆ maySelectNone()

bool hdps::gui::HierarchyWidget::maySelectNone ( ) const
protected

Get whether one (or more) items can be de-selected

Returns
Boolean determining whether one (or more) items can be de-selected

◆ selectAll()

void hdps::gui::HierarchyWidget::selectAll ( )
protected

Select all items in the hierarchy

◆ selectNone()

void hdps::gui::HierarchyWidget::selectNone ( )
protected

Deselect all selected items in the hierarchy

◆ setHeaderHidden()

void hdps::gui::HierarchyWidget::setHeaderHidden ( bool  headerHidden)

Set whether the header view is visible or not

Parameters
headerHiddenBoolean determining whether the header view is visible or not

◆ setItemTypeName()

void hdps::gui::HierarchyWidget::setItemTypeName ( const QString &  itemTypeName)

Set item type name to itemTypeName

Returns
Item type name

◆ setNoItemsDescription()

void hdps::gui::HierarchyWidget::setNoItemsDescription ( const QString &  noItemsDescription)

Set overlay widget description when no items are loaded

Parameters
noItemsDescriptionOverlay widget description when no items are loaded

◆ setWindowIcon()

void hdps::gui::HierarchyWidget::setWindowIcon ( const QIcon &  icon)

Override set window icon to update the overlay icons as well

Parameters
iconWindow icon

◆ toSourceModelIndex()

QModelIndex hdps::gui::HierarchyWidget::toSourceModelIndex ( const QModelIndex &  modelIndex) const

Maps a model index to source model index

Parameters
modelIndexModel index to map
Returns
The mapped model index if a filter model is present, other wise the input model index

◆ updateHeaderVisibility()

void hdps::gui::HierarchyWidget::updateHeaderVisibility ( )
protected

Updates the visibility of the header


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