pqProxyWidget.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 pqProxyWidget_h
5 #define pqProxyWidget_h
6 
7 #include "pqComponentsModule.h"
8 #include <QSet>
9 #include <QWidget>
10 
11 class pqPropertyWidget;
12 class pqView;
13 class vtkSMProperty;
14 class vtkSMProxy;
15 class QPoint;
16 
31 class PQCOMPONENTS_EXPORT pqProxyWidget : public QWidget
32 {
33  Q_OBJECT
34  typedef QWidget Superclass;
35 
36 public:
37  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties,
38  std::initializer_list<QString> defaultLabels, std::initializer_list<QString> advancedLabels,
39  bool showHeadersFooters = true, QWidget* parent = nullptr,
40  Qt::WindowFlags flags = Qt::WindowFlags{});
41 
42  pqProxyWidget(vtkSMProxy* proxy, std::initializer_list<QString> defaultLabels,
43  std::initializer_list<QString> advancedLabels, QWidget* parent = nullptr,
44  Qt::WindowFlags flags = Qt::WindowFlags{});
45 
46  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties, bool showHeadersFooters = true,
47  QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags{});
48 
49  pqProxyWidget(vtkSMProxy* proxy, QWidget* parent, Qt::WindowFlags flags = Qt::WindowFlags{});
50 
51  pqProxyWidget(vtkSMProxy* proxy);
52 
53  ~pqProxyWidget() override;
54 
58  vtkSMProxy* proxy() const;
59 
65  void setApplyChangesImmediately(bool value);
66  bool applyChangesImmediately() const { return this->ApplyChangesImmediately; }
67 
74  bool useDocumentationForLabels() const { return this->UseDocumentationForLabels; }
75 
81  static QWidget* newGroupLabelWidget(const QString& label, QWidget* parentWidget,
82  const QList<QWidget*>& buttons = QList<QWidget*>());
83 
89  static bool useDocumentationForLabels(vtkSMProxy* proxy);
90 
92  {
96  USE_LONG_HELP
97  };
98 
103  static QString documentationText(
104  vtkSMProperty* property, DocumentationType type = USE_DESCRIPTION);
105 
110  static QString documentationText(vtkSMProxy* property, DocumentationType type = USE_DESCRIPTION);
111 
117  static DocumentationType showProxyDocumentationInPanel(vtkSMProxy* proxy);
118 
120 
132  const QSet<QString>& defaultVisibilityLabels() const { return this->DefaultVisibilityLabels; }
133  const QSet<QString>& advancedVisibilityLabels() const { return this->AdvancedVisibilityLabels; }
135 
136  void showContextMenu(const QPoint& pt, pqPropertyWidget* propWidget);
137 
138 Q_SIGNALS:
143  void changeAvailable();
144 
149  void changeFinished();
150 
155  void restartRequired();
156 
157 public Q_SLOTS:
164  bool filterWidgets(bool show_advanced = false, const QString& filterText = QString());
165 
170  void showLinkedInteractiveWidget(int portIndex, bool show, bool changeFocus);
171 
175  void apply() const;
176 
180  void reset() const;
181 
185  void setView(pqView*);
186 
191  void updatePanel();
192 
197  virtual bool restoreDefaults();
198 
202  void saveAsDefaults();
203 
207  static pqPropertyWidget* createWidgetForProperty(
208  vtkSMProperty* property, vtkSMProxy* proxy, QWidget* parentObj);
209 
210 protected:
211  void showEvent(QShowEvent* event) override;
212  void hideEvent(QHideEvent* event) override;
213 
214 private Q_SLOTS:
219  void onChangeFinished();
220 
221 private: // NOLINT(readability-redundant-access-specifiers)
225  void createWidgets(const QStringList& properties = QStringList());
226 
230  void createPropertyWidgets(const QStringList& properties = QStringList());
231 
235  void create3DWidgets();
236 
237  Q_DISABLE_COPY(pqProxyWidget);
238 
239  QSet<QString> DefaultVisibilityLabels;
240  QSet<QString> AdvancedVisibilityLabels;
241  bool ApplyChangesImmediately;
242  bool UseDocumentationForLabels;
243  bool ShowHeadersFooters = false;
244  class pqInternals;
245  pqInternals* Internals;
246 };
247 
248 #endif
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
#define PQCOMPONENTS_EXPORT
bool applyChangesImmediately() const
Definition: pqProxyWidget.h:66
bool useDocumentationForLabels() const
When this is true, the panel uses a descriptive layout where the documentation for properties is used...
Definition: pqProxyWidget.h:74
superclass for all SM properties
This is a PQ abstraction of a generic view module.
Definition: pqView.h:26
const QSet< QString > & advancedVisibilityLabels() const
pqProxyWidget shows widgets for properties in two configurations: basic and advanced.
const QSet< QString > & defaultVisibilityLabels() const
pqProxyWidget shows widgets for properties in two configurations: basic and advanced.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
value
pqProxyWidget represents a panel for a vtkSMProxy.
Definition: pqProxyWidget.h:31