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 
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
QObject * objectQt() const
Provides access to the Qt QObject and property name.
superclass for all SM properties
#define PQCORE_EXPORT
Definition: pqCoreModule.h:15
void setTraceChanges(bool trace)
Provide access to whether changes sent from Qt to the server manager are traceable.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
value
pqPropertyLinksConnection is used by pqPropertyLinks to keep a QObject and vtkSMProperty linked toget...
const QString & propertyQt() const
VTKCOMMONCORE_EXPORT bool operator==(const vtkUnicodeString &lhs, const vtkUnicodeString &rhs)
vtkSMProperty * propertySM() const
vtkSMProxy * proxy() const
Provides access to the ServerManager proxy/property/index.