Public Slots | Signals | Public Member Functions | List of all members
pqPropertyLinks Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ pqPropertyLinks()

pqPropertyLinks::pqPropertyLinks ( QObject *  parent = nullptr)

◆ ~pqPropertyLinks()

pqPropertyLinks::~pqPropertyLinks ( )
override

Member Function Documentation

◆ addPropertyLink() [1/2]

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.

◆ addTraceablePropertyLink() [1/2]

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.

◆ addPropertyLink() [2/2]

template<class ConnectionType >
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 182 of file pqPropertyLinks.h.

◆ addTraceablePropertyLink() [2/2]

template<class ConnectionType >
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 192 of file pqPropertyLinks.h.

◆ removePropertyLink()

bool pqPropertyLinks::removePropertyLink ( QObject *  qobject,
const char *  qproperty,
const char *  qsignal,
vtkSMProxy smproxy,
vtkSMProperty smproperty,
int  smindex = -1 
)

Remove a particular link.

◆ autoUpdateVTKObjects()

bool pqPropertyLinks::autoUpdateVTKObjects ( ) const
inline

Definition at line 97 of file pqPropertyLinks.h.

◆ useUncheckedProperties()

bool pqPropertyLinks::useUncheckedProperties ( ) const
inline

Definition at line 98 of file pqPropertyLinks.h.

◆ removeAllPropertyLinks

void pqPropertyLinks::removeAllPropertyLinks ( )
inlineslot

Remove all links.

Definition at line 104 of file pqPropertyLinks.h.

◆ clear

void pqPropertyLinks::clear ( )
slot

◆ accept

void pqPropertyLinks::accept ( )
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.

◆ reset

void pqPropertyLinks::reset ( )
slot

Set the qobject values using the smproperty values.

This also clears any unchecked values that may be set on the smproperty.

◆ setUseUncheckedProperties

void pqPropertyLinks::setUseUncheckedProperties ( bool  val)
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

◆ setAutoUpdateVTKObjects

void pqPropertyLinks::setAutoUpdateVTKObjects ( bool  val)
inlineslot

set whether UpdateVTKObjects is called automatically when needed

Definition at line 130 of file pqPropertyLinks.h.

◆ qtWidgetChanged

void pqPropertyLinks::qtWidgetChanged ( )
signal

◆ smPropertyChanged

void pqPropertyLinks::smPropertyChanged ( )
signal

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