pqArraySelectionWidget is a widget used to allow user to select arrays. More...
#include <pqArraySelectionWidget.h>
Signals | |
void | widgetModified () |
fired whenever the check state has been modified. More... | |
Public Member Functions | |
pqArraySelectionWidget (int numColumns, QWidget *parent=nullptr) | |
pqArraySelectionWidget (QWidget *parent=nullptr) | |
~pqArraySelectionWidget () override | |
bool | event (QEvent *e) override |
overridden to handle QDynamicPropertyChangeEvent events. More... | |
void | setColumnItemData (int column, int role, const QVariant &data) |
API to add custom item data for each column. More... | |
void | setHeaderLabel (const QString &label) |
Specify a label to use for the horizontal header for the view. More... | |
void | setHeaderLabel (int column, const QString &label) |
Specify a label to use for the horizontal header for the view. More... | |
QString | headerLabel (int column=0) const |
Specify a label to use for the horizontal header for the view. More... | |
void | setIconType (const QString &pname, const QString &icon_type) |
Specify an icon type to use for a property with the given name. More... | |
const QString & | iconType (const QString &pname) const |
Specify an icon type to use for a property with the given name. More... | |
void | setColumnData (int column, const QString &pname, QMap< QString, QString > &&mapping) |
Add additional column with meta-data for each row. More... | |
![]() | |
pqTreeView (QWidget *parent=nullptr, bool use_pqHeaderView=false) | |
~pqTreeView () override=default | |
bool | eventFilter (QObject *object, QEvent *e) override |
void | wheelEvent (QWheelEvent *event) override |
Overridden to eat wheel events unless this->hasFocus(). More... | |
void | setModel (QAbstractItemModel *model) override |
void | setRootIndex (const QModelIndex &index) override |
QSize | sizeHint () const override |
QSize | minimumSizeHint () const override |
void | setMaximumRowCountBeforeScrolling (int val) |
int | maximumRowCountBeforeScrolling () const |
void | setupCustomHeader (bool use_pqHeaderView=false) |
Helper method to change the header type after construction. More... | |
Friends | |
class | Model |
Additional Inherited Members | |
![]() | |
QItemSelectionModel::SelectionFlags | selectionCommand (const QModelIndex &index, const QEvent *event=nullptr) const override |
We need to change two things about how Qt manages toggling check state of a selected item (see paraview/paraview#18150). More... | |
bool | edit (const QModelIndex &index, EditTrigger trigger, QEvent *event) override |
We need to change two things about how Qt manages toggling check state of a selected item (see paraview/paraview#18150). More... | |
![]() | |
int | maximumRowCountBeforeScrolling |
Set the maximum number of rows beyond which this view should show a vertical scroll bar. More... | |
pqArraySelectionWidget is a widget used to allow user to select arrays.
pqArraySelectionWidget shows a list of items to select (or check) using check boxes next to each of the items.
pqArraySelectionWidget uses pqTreeView as the view and internally build a QAbstractItemModel subclass to track the state.
For several readers, e.g. ExodusIIReader, there could be multiple properties that control array status. We want a single widget to show and control the selection states for all those properties. To support that, we use dynamic properties. Simply hook up the same pqArraySelectionWidget with multiple properties via pqPropertyLinks, using any name of the Qt property name when setting up the connection.
pqArraySelectionWidget is based on a class known as pqExodusIIVariableSelectionWidget. pqExodusIIVariableSelectionWidget, however was a pqTreeWidget subclass. This, however, uses pqTreeView which is the recommended approach since it provides a better user experience when dealing with large lists.
To help the user with checking multiple items, filtering, and sorting, you may want to connect pqArraySelectionWidget with a pqTreeViewSelectionHelper.
In certain case, it's helpful to show additional columns that provide additional information about each of the row e.g. for exodus files, we may want to show exodus block ids. Such columns can be added by using setColumnData
to provide a map with the mapping. In that case, the pqArraySelectionWidget must be created by passing the target column count in the constructor.
Definition at line 53 of file pqArraySelectionWidget.h.
pqArraySelectionWidget::pqArraySelectionWidget | ( | int | numColumns, |
QWidget * | parent = nullptr |
||
) |
pqArraySelectionWidget::pqArraySelectionWidget | ( | QWidget * | parent = nullptr | ) |
|
override |
|
override |
overridden to handle QDynamicPropertyChangeEvent events.
|
inline |
Specify a label to use for the horizontal header for the view.
Definition at line 72 of file pqArraySelectionWidget.h.
Specify a label to use for the horizontal header for the view.
QString pqArraySelectionWidget::headerLabel | ( | int | column = 0 | ) | const |
Specify a label to use for the horizontal header for the view.
Specify an icon type to use for a property with the given name.
Supported icon types are point, cell, field, vertex, edge, row, face, side-set, node-set, face-set, edge-set, cell-set, node-map, edge-map, face-map.
Specify an icon type to use for a property with the given name.
Supported icon types are point, cell, field, vertex, edge, row, face, side-set, node-set, face-set, edge-set, cell-set, node-map, edge-map, face-map.
void pqArraySelectionWidget::setColumnData | ( | int | column, |
const QString & | pname, | ||
QMap< QString, QString > && | mapping | ||
) |
Add additional column with meta-data for each row.
API to add custom item data for each column.
|
signal |
fired whenever the check state has been modified.
|
friend |
Definition at line 124 of file pqArraySelectionWidget.h.