pqPropertyLinksConnection.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqPropertyLinksConnection_h
5 #define pqPropertyLinksConnection_h
6 
7 #include <QObject>
8 #include <QPointer>
9 
10 #include "pqCoreModule.h"
11 #include "vtkEventQtSlotConnect.h"
12 #include "vtkNew.h"
13 #include "vtkSMProperty.h"
14 #include "vtkSMProxy.h"
15 #include "vtkWeakPointer.h"
16 
17 class pqPropertyLinks;
18 
26 class PQCORE_EXPORT pqPropertyLinksConnection : public QObject
27 {
28  Q_OBJECT
29  typedef QObject Superclass;
30 
31 public:
36  pqPropertyLinksConnection(QObject* qobject, const char* qproperty, const char* qsignal,
37  vtkSMProxy* smproxy, vtkSMProperty* smproperty, int smindex, bool use_unchecked_modified_event,
38  QObject* parentObject = nullptr);
39 
40  ~pqPropertyLinksConnection() override;
41 
42  void setUseUncheckedProperties(bool useUnchecked);
43 
47  bool operator==(const pqPropertyLinksConnection& other) const;
48 
52  QObject* objectQt() const { return this->ObjectQt; }
53  const QString& propertyQt() const { return this->PropertyQt; }
54 
58  vtkSMProxy* proxy() const { return this->ProxySM; }
59  vtkSMProxy* proxySM() const { return this->ProxySM; }
60  vtkSMProperty* propertySM() const { return this->PropertySM; }
61  int indexSM() const { return this->IndexSM; }
62 
66  void setTraceChanges(bool trace) { this->TraceChanges = trace; }
67  bool traceChanges() const { return this->TraceChanges; }
68 
69 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
74  void copyValuesFromServerManagerToQt(bool use_unchecked);
75 
80  void copyValuesFromQtToServerManager(bool use_unchecked);
81 
82 protected:
87  virtual void setQtValue(const QVariant& value);
88  virtual void setServerManagerValue(bool use_unchecked, const QVariant& value);
89  virtual QVariant currentQtValue() const;
90  virtual QVariant currentServerManagerValue(bool use_unchecked) const;
91 
92 Q_SIGNALS:
97  void qtpropertyModified();
98 
103  void smpropertyModified();
104 
105 private:
106  Q_DISABLE_COPY(pqPropertyLinksConnection)
107  vtkNew<vtkEventQtSlotConnect> VTKConnector;
108 
109  QPointer<QObject> ObjectQt;
110  QString PropertyQt;
111  QString SignalQt;
112 
115  int IndexSM;
116  bool TraceChanges;
117 };
118 
119 #endif
vtkEventQtSlotConnect.h
vtkSMProperty.h
pqPropertyLinksConnection::propertyQt
const QString & propertyQt() const
Definition: pqPropertyLinksConnection.h:53
pqPropertyLinksConnection::propertySM
vtkSMProperty * propertySM() const
Definition: pqPropertyLinksConnection.h:60
vtkSMProperty
superclass for all SM properties
Definition: vtkSMProperty.h:144
vtkSMProxy
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
pqPropertyLinksConnection::indexSM
int indexSM() const
Definition: pqPropertyLinksConnection.h:61
pqPropertyLinksConnection::proxy
vtkSMProxy * proxy() const
Provides access to the ServerManager proxy/property/index.
Definition: pqPropertyLinksConnection.h:58
vtkNew< vtkEventQtSlotConnect >
vtkWeakPointer.h
pqPropertyLinksConnection
pqPropertyLinksConnection is used by pqPropertyLinks to keep a QObject and vtkSMProperty linked toget...
Definition: pqPropertyLinksConnection.h:26
operator==
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
pqPropertyLinksConnection::proxySM
vtkSMProxy * proxySM() const
Definition: pqPropertyLinksConnection.h:59
vtkSMProxy.h
vtkNew.h
pqPropertyLinksConnection::objectQt
QObject * objectQt() const
Provides access to the Qt QObject and property name.
Definition: pqPropertyLinksConnection.h:52
pqPropertyLinksConnection::traceChanges
bool traceChanges() const
Definition: pqPropertyLinksConnection.h:67
vtkWeakPointer< vtkSMProxy >
pqPropertyLinksConnection::setTraceChanges
void setTraceChanges(bool trace)
Provide access to whether changes sent from Qt to the server manager are traceable.
Definition: pqPropertyLinksConnection.h:66