pqPropertyLinks is used to connect vtkSMProperty and subclasses to properties on QObject instances. More...
#include <pqPropertyLinks.h>
Inherits QObject.
Public Slots | |
void | removeAllPropertyLinks () |
Remove all links. More... | |
void | clear () |
void | accept () |
When UseUncheckedProperties == true, the smproperty values are not changed whenever the qobject is modified. More... | |
void | reset () |
Set the qobject values using the smproperty values. More... | |
void | setUseUncheckedProperties (bool val) |
set whether to use unchecked properties on the server manager one may get/set unchecked properties to get domain updates before an accept is done More... | |
void | setAutoUpdateVTKObjects (bool val) |
set whether UpdateVTKObjects is called automatically when needed More... | |
Signals | |
void | qtWidgetChanged () |
void | smPropertyChanged () |
Public Member Functions | |
pqPropertyLinks (QObject *parent=nullptr) | |
~pqPropertyLinks () override | |
bool | addPropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1) |
Setup a link between a Qt property and vtkSMProperty on a vtkSMProxy instance. More... | |
bool | addTraceablePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1) |
Like addPropertyLink, but also sets up properties to be Python traceable. More... | |
template<class ConnectionType > | |
bool | addPropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1, ConnectionType *notused=nullptr) |
Like addPropertyLink, but used to create a custom subclass of pqPropertyLinksConnection. More... | |
template<class ConnectionType > | |
bool | addTraceablePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1, ConnectionType *notused=nullptr) |
Like addPropertyLink, but used to create a custom subclass of pqPropertyLinksConnection and flag it as traceable. More... | |
bool | removePropertyLink (QObject *qobject, const char *qproperty, const char *qsignal, vtkSMProxy *smproxy, vtkSMProperty *smproperty, int smindex=-1) |
Remove a particular link. More... | |
bool | autoUpdateVTKObjects () const |
bool | useUncheckedProperties () const |
int | getNumberOfPropertyLinks () const |
Returns the number of property links. More... | |
pqPropertyLinksConnection * | getPropertyLink (int index) const |
Returns the property link at the given index. More... | |
pqPropertyLinks is used to connect vtkSMProperty and subclasses to properties on QObject instances.
pqPropertyLinks enables setting up a link between QWidgets and vtkSMProperty's so that whenever one of them changes, the other is updated as well.
vtkSMProperty has two types of values, checked and unchecked. This class by default uses checked values, but it can be told to use unchecked values using setUseUncheckedProperties(). When setUseUncheckedProperties() is set to true, one can use accept()/reset() to accept or discard any changes to the vtkSMProperty.
When setUseUncheckedProperties() is set to false (default), one can set setAutoUpdateVTKObjects() to true (default false) to ensure that vtkSMProxy::UpdateVTKObjects() is called whenever the property changes.
This class uses weak-references to both the Qt and ServerManager objects hence it's safe to destroy either of those without updating the pqPropertyLinks instance.
Also, pqPropertyLinks never uses any delayed timers or connections.
Definition at line 38 of file pqPropertyLinks.h.
pqPropertyLinks::pqPropertyLinks | ( | QObject * | parent = nullptr | ) |
|
override |
bool pqPropertyLinks::addPropertyLink | ( | QObject * | qobject, |
const char * | qproperty, | ||
const char * | qsignal, | ||
vtkSMProxy * | smproxy, | ||
vtkSMProperty * | smproperty, | ||
int | smindex = -1 |
||
) |
Setup a link between a Qt property and vtkSMProperty on a vtkSMProxy instance.
The QObject is updated using the vtkSMProperty's current value immediately. Arguments:
qobject
:- the Qt object qproperty
:- the Qt property name on qobject
that can be used to get/set the object's value(s). qsignal
:- signal fired by the qobject
whenever it's property value changes. smproxy
:- the vtkSMProxy instance. smproperty
:- the vtkSMProperty from the proxy
. smindex
:- for multi-element properties, specify a non-negative value to link to a particular element of the vtkSMProperty.. Returns false if link adding fails for some reason. bool pqPropertyLinks::addTraceablePropertyLink | ( | QObject * | qobject, |
const char * | qproperty, | ||
const char * | qsignal, | ||
vtkSMProxy * | smproxy, | ||
vtkSMProperty * | smproperty, | ||
int | smindex = -1 |
||
) |
Like addPropertyLink, but also sets up properties to be Python traceable.
bool pqPropertyLinks::addPropertyLink | ( | QObject * | qobject, |
const char * | qproperty, | ||
const char * | qsignal, | ||
vtkSMProxy * | smproxy, | ||
vtkSMProperty * | smproperty, | ||
int | smindex = -1 , |
||
ConnectionType * | notused = nullptr |
||
) |
Like addPropertyLink, but used to create a custom subclass of pqPropertyLinksConnection.
Definition at line 192 of file pqPropertyLinks.h.
bool pqPropertyLinks::addTraceablePropertyLink | ( | QObject * | qobject, |
const char * | qproperty, | ||
const char * | qsignal, | ||
vtkSMProxy * | smproxy, | ||
vtkSMProperty * | smproperty, | ||
int | smindex = -1 , |
||
ConnectionType * | notused = nullptr |
||
) |
Like addPropertyLink, but used to create a custom subclass of pqPropertyLinksConnection and flag it as traceable.
Note that subclasses of pqPropertyLinksConnection may ignore the TraceChanges flag set on it with this method.
Definition at line 202 of file pqPropertyLinks.h.
bool pqPropertyLinks::removePropertyLink | ( | QObject * | qobject, |
const char * | qproperty, | ||
const char * | qsignal, | ||
vtkSMProxy * | smproxy, | ||
vtkSMProperty * | smproperty, | ||
int | smindex = -1 |
||
) |
Remove a particular link.
|
inline |
Definition at line 97 of file pqPropertyLinks.h.
|
inline |
Definition at line 98 of file pqPropertyLinks.h.
int pqPropertyLinks::getNumberOfPropertyLinks | ( | ) | const |
Returns the number of property links.
pqPropertyLinksConnection* pqPropertyLinks::getPropertyLink | ( | int | index | ) | const |
Returns the property link at the given index.
|
inlineslot |
Remove all links.
Definition at line 114 of file pqPropertyLinks.h.
|
slot |
|
slot |
When UseUncheckedProperties == true, the smproperty values are not changed whenever the qobject is modified.
Use this method to change the smproperty values using the current qobject values.
|
slot |
Set the qobject values using the smproperty values.
This also clears any unchecked values that may be set on the smproperty.
|
slot |
set whether to use unchecked properties on the server manager one may get/set unchecked properties to get domain updates before an accept is done
|
inlineslot |
set whether UpdateVTKObjects is called automatically when needed
Definition at line 140 of file pqPropertyLinks.h.
|
signal |
|
signal |