32 #ifndef pqPropertyLinks_h 33 #define pqPropertyLinks_h 38 #include "pqCoreModule.h" 69 typedef QObject Superclass;
92 bool addPropertyLink(QObject* qobject,
const char* qproperty,
const char* qsignal,
98 bool addTraceablePropertyLink(QObject* qobject,
const char* qproperty,
const char* qsignal,
104 template <
class ConnectionType>
105 bool addPropertyLink(QObject* qobject,
const char* qproperty,
const char* qsignal,
107 ConnectionType* notused = NULL);
114 template <
class ConnectionType>
115 bool addTraceablePropertyLink(QObject* qobject,
const char* qproperty,
const char* qsignal,
117 ConnectionType* notused = NULL);
122 bool removePropertyLink(QObject* qobject,
const char* qproperty,
const char* qsignal,
153 void setUseUncheckedProperties(
bool val);
161 void qtWidgetChanged();
162 void smPropertyChanged();
169 void onQtPropertyModified();
170 void onSMPropertyModified();
175 template <
class ConnectionType>
176 ConnectionType* addPropertyLinkInternal(QObject* qobject,
const char* qproperty,
183 pqInternals* Internals;
184 bool UseUncheckedProperties;
185 bool AutoUpdateVTKObjects;
189 template <
class ConnectionType>
190 ConnectionType* pqPropertyLinks::addPropertyLinkInternal(QObject* qobject,
const char* qproperty,
193 if (!qobject || !qproperty || !qsignal || !smproxy || !smproperty)
195 qCritical() <<
"Invalid parameters to pqPropertyLinks::addPropertyLinkInternal";
196 qDebug() <<
"(" << qobject <<
", " << qproperty <<
", " << qsignal <<
") <==> (" 197 << (smproxy ? smproxy->
GetXMLName() :
"(none)") <<
"," 198 << (smproperty ? smproperty->
GetXMLLabel() :
"(none)") << smindex <<
")";
202 ConnectionType* connection =
new ConnectionType(qobject, qproperty, qsignal, smproxy, smproperty,
204 this->addNewConnection(connection);
210 template <
class ConnectionType>
214 auto connection = this->addPropertyLinkInternal<ConnectionType>(
215 qobject, qproperty, qsignal, smproxy, smproperty, smindex);
216 return connection !=
nullptr;
220 template <
class ConnectionType>
224 auto connection = this->addPropertyLinkInternal<ConnectionType>(
225 qobject, qproperty, qsignal, smproxy, smproperty, smindex);
228 connection->setTraceChanges(
true);
bool useUncheckedProperties() const
superclass for all SM properties
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.
virtual char * GetXMLLabel()
The label assigned by the xml parser.
pqPropertyLinks is used to connect vtkSMProperty and subclasses to properties on QObject instances.
bool autoUpdateVTKObjects() const
proxy for a VTK object(s) on a server
void setAutoUpdateVTKObjects(bool val)
set whether UpdateVTKObjects is called automatically when needed
void removeAllPropertyLinks()
Remove all links.
pqPropertyLinksConnection is used by pqPropertyLinks to keep a QObject and vtkSMProperty linked toget...
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.
virtual char * GetXMLName()
Assigned by the XML parser.