Signals | Public Member Functions | Friends | List of all members
pqArraySelectionWidget Class Reference

pqArraySelectionWidget is a widget used to allow user to select arrays. More...

#include <pqArraySelectionWidget.h>

Inheritance diagram for pqArraySelectionWidget:
Inheritance graph
[legend]
Collaboration diagram for pqArraySelectionWidget:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from pqTreeView
 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

- Protected Member Functions inherited from pqTreeView
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...
 
- Properties inherited from pqTreeView
int maximumRowCountBeforeScrolling
 Set the maximum number of rows beyond which this view should show a vertical scroll bar. More...
 

Detailed Description

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.

Implementation Details

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.

Legacy Information

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.

Improving user experience

To help the user with checking multiple items, filtering, and sorting, you may want to connect pqArraySelectionWidget with a pqTreeViewSelectionHelper.

Additional columns

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.

Constructor & Destructor Documentation

◆ pqArraySelectionWidget() [1/2]

pqArraySelectionWidget::pqArraySelectionWidget ( int  numColumns,
QWidget *  parent = nullptr 
)

◆ pqArraySelectionWidget() [2/2]

pqArraySelectionWidget::pqArraySelectionWidget ( QWidget *  parent = nullptr)

◆ ~pqArraySelectionWidget()

pqArraySelectionWidget::~pqArraySelectionWidget ( )
override

Member Function Documentation

◆ event()

bool pqArraySelectionWidget::event ( QEvent *  e)
override

overridden to handle QDynamicPropertyChangeEvent events.

◆ setHeaderLabel() [1/2]

void pqArraySelectionWidget::setHeaderLabel ( const QString &  label)
inline

Specify a label to use for the horizontal header for the view.

Definition at line 72 of file pqArraySelectionWidget.h.

◆ setHeaderLabel() [2/2]

void pqArraySelectionWidget::setHeaderLabel ( int  column,
const QString &  label 
)

Specify a label to use for the horizontal header for the view.

◆ headerLabel()

QString pqArraySelectionWidget::headerLabel ( int  column = 0) const

Specify a label to use for the horizontal header for the view.

◆ setIconType()

void pqArraySelectionWidget::setIconType ( const QString &  pname,
const QString &  icon_type 
)

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.

◆ iconType()

const QString& pqArraySelectionWidget::iconType ( const QString &  pname) const

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.

◆ setColumnData()

void pqArraySelectionWidget::setColumnData ( int  column,
const QString &  pname,
QMap< QString, QString > &&  mapping 
)

Add additional column with meta-data for each row.

◆ setColumnItemData()

void pqArraySelectionWidget::setColumnItemData ( int  column,
int  role,
const QVariant &  data 
)

API to add custom item data for each column.

◆ widgetModified

void pqArraySelectionWidget::widgetModified ( )
signal

fired whenever the check state has been modified.

Friends And Related Function Documentation

◆ Model

friend class Model
friend

Definition at line 124 of file pqArraySelectionWidget.h.


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