Signals | Public Member Functions | List of all members
pqPropertyCollectionWidget Class Reference

property widget for properties representing collection of parameters. More...

#include <pqPropertyCollectionWidget.h>

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

Signals

void widgetModified ()
 
- Signals inherited from pqPropertyWidget
void viewChanged (pqView *view)
 This signal is emitted when the current view changes. More...
 
void changeAvailable ()
 This signal is fired as soon as the user starts editing in the widget. More...
 
void changeFinished ()
 This signal is fired as soon as the user is done with making an atomic change. More...
 
void restartRequired ()
 Indicates that a restart of the program is required for the setting to take effect. More...
 

Public Member Functions

 pqPropertyCollectionWidget (vtkSMProxy *proxy, vtkSMPropertyGroup *smgroup, QWidget *parent=nullptr)
 
 ~pqPropertyCollectionWidget () override
 
bool event (QEvent *e) override
 Overridden to handle QDynamicPropertyChangeEvent events. More...
 
- Public Member Functions inherited from pqPropertyWidget
 pqPropertyWidget (vtkSMProxy *proxy, QWidget *parent=nullptr)
 
 ~pqPropertyWidget () override
 
virtual void apply ()
 
virtual void reset ()
 
virtual void updateWidget (bool showing_advanced_properties)
 
pqViewview () const
 
vtkSMProxyproxy () const
 
vtkSMPropertyproperty () const
 
virtual char * panelVisibility () const
 Forward calls to vtkSMProperty. More...
 
virtual void setPanelVisibility (const char *vis)
 
virtual bool isSingleRowItem () const
 Determines if the PropertyWidget must be constructed using a single row. More...
 
bool showLabel () const
 
const QList< QPointer< pqPropertyWidgetDecorator > > & decorators () const
 Provides access to the decorators for this widget. More...
 
virtual void setReadOnly (bool readOnly)
 Set widget in read-only mode. More...
 
void setProperty (vtkSMProperty *property)
 
virtual void select ()
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 
virtual void selectPort (int portIndex)
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 
virtual void deselect ()
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 
bool isSelected () const
 These methods are called by pqPropertiesPanel when the panel for proxy becomes active/deactive. More...
 

Additional Inherited Members

- Public Slots inherited from pqPropertyWidget
virtual void setView (pqView *)
 called to set the active view. More...
 
- Static Public Member Functions inherited from pqPropertyWidget
template<class T >
static QString getXMLName (T *object)
 Description: This static utility method returns the XML name for an object as a QString. More...
 
static QString getTooltip (vtkSMProperty *property)
 Returns the tooltip to use for the property. More...
 
static int hintsWidgetHeightNumberOfRows (vtkPVXMLElement *hints, int defaultValue=10)
 Helper method to return value from WidgetHeight XML hint, if any. More...
 
static std::vector< std::stringparseComponentLabels (vtkPVXMLElement *hints, unsigned int elemCount=0)
 Parse a XML element as a list of label to use for this widget. More...
 
- Protected Member Functions inherited from pqPropertyWidget
void addPropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProperty *smproperty, int smindex=-1)
 
void addPropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1)
 
void removePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProperty *smproperty, int smindex=-1)
 
void removePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1)
 
void setShowLabel (bool show)
 
void setChangeAvailableAsChangeFinished (bool status)
 For most pqPropertyWidget subclasses a changeAvailable() signal, corresponds to a changeFinished() signal. More...
 
void addDecorator (pqPropertyWidgetDecorator *)
 Register a decorator. More...
 
void removeDecorator (pqPropertyWidgetDecorator *)
 Unregisters a decorator. More...
 
pqPropertyLinkslinks ()
 Provides access to the pqPropertyLinks instance. More...
 

Detailed Description

property widget for properties representing collection of parameters.

pqPropertyCollectionWidget is designed for a specific use-case: a group of properties on a proxy all of which are repeatable vector properties (i.e. vtkSMVectorProperty subclasses) where each repeatable item in the collection is to be edited together. Another way of describing the same is that each vector property in the group defines a column in a table with user having the ability to add and remove rows to this table. However, instead of showing a literal tabular widget to edit values in each row, a prototype proxy definition is provided using hints.

Example proxy definition(s) that use this widget is as follows:

<SourceProxy class="vtkSteeringDataGenerator" name="Oscillators">
<DoubleVectorProperty name="Center"
command="SetTuple3Double"
use_index="1"
clean_command="Clear"
initial_string="coords"
number_of_elements_per_command="3"
repeat_command="1">
</DoubleVectorProperty>
<IntVectorProperty name="Type"
command="SetTuple1Int"
clean_command="Clear"
use_index="1"
initial_string="type"
number_of_elements_per_command="1"
repeat_command="1">
</IntVectorProperty>
<PropertyGroup label="Oscillators" panel_widget="PropertyCollection">
<Property name="Center" function="PrototypeCenter" />
<Property name="Type" function="PrototypeType" />
<!-- here, "name" identifies the property on this proxy, while
"function" identifies the property on the prototype proxy. If
"function" is not specified, same value as "name" is assumed. -->
<Hints>
<PropertyCollectionWidgetPrototype group="misc" name="OscillatorPrototype" />
</Hints>
</PropertyGroup>
</SourceProxy>

The prototype proxy to use to build the UI for each row in this table that has two columns for "Center" and "Type" is identified using the PropertyCollectionWidgetPrototype hint added to the PropertyGroup element. Following is an example definition:

<ProxyGroup name="misc">
<Proxy name="OscillatorPrototype" label="Oscillator" >
<DoubleVectorProperty name="PrototypeCenter"
label="Center"
number_of_elements="3"
default_values="0 0 0">
<DoubleRangeDomain name="range" />
<Documentation>
Specify center for the oscillator.
</Documentation>
</DoubleVectorProperty>
<IntVectorProperty name="PrototypeType"
label="Type"
number_of_elements="1"
default_values="0">
<EnumerationDomain name="enum">
<Entry text="damped" value="0" />
<Entry text="decaying" value="1" />
<Entry text="periodic" value="2" />
</EnumerationDomain>
</IntVectorProperty>
</Proxy>
</ProxyGroup>

A few things to note:

Definition at line 100 of file pqPropertyCollectionWidget.h.

Constructor & Destructor Documentation

◆ pqPropertyCollectionWidget()

pqPropertyCollectionWidget::pqPropertyCollectionWidget ( vtkSMProxy proxy,
vtkSMPropertyGroup smgroup,
QWidget *  parent = nullptr 
)

◆ ~pqPropertyCollectionWidget()

pqPropertyCollectionWidget::~pqPropertyCollectionWidget ( )
override

Member Function Documentation

◆ event()

bool pqPropertyCollectionWidget::event ( QEvent *  e)
override

Overridden to handle QDynamicPropertyChangeEvent events.

◆ widgetModified

void pqPropertyCollectionWidget::widgetModified ( )
signal

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