pqProxyWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) 2005,2006 Sandia Corporation, Kitware Inc.
7  All rights reserved.
8 
9  ParaView is a free software; you can redistribute it and/or modify it
10  under the terms of the ParaView license version 1.2.
11 
12  See License_v1.2.txt for the full ParaView license.
13  A copy of this license can be obtained by contacting
14  Kitware Inc.
15  28 Corporate Drive
16  Clifton Park, NY 12065
17  USA
18 
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
23 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 ========================================================================*/
32 #ifndef pqProxyWidget_h
33 #define pqProxyWidget_h
34 
35 #include "pqComponentsModule.h"
36 #include <QWidget>
37 
38 class pqPropertyWidget;
39 class pqView;
40 class vtkSMProperty;
41 class vtkSMProxy;
42 
57 class PQCOMPONENTS_EXPORT pqProxyWidget : public QWidget
58 {
59  Q_OBJECT
60  typedef QWidget Superclass;
61 
62 public:
64  vtkSMProxy* proxy, QWidget* parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags{});
65  pqProxyWidget(vtkSMProxy* proxy, const QStringList& properties, bool showHeadersFooters = true,
66  QWidget* parent = 0, Qt::WindowFlags flags = Qt::WindowFlags{});
67  ~pqProxyWidget() override;
68 
72  vtkSMProxy* proxy() const;
73 
79  void setApplyChangesImmediately(bool value);
80  bool applyChangesImmediately() const { return this->ApplyChangesImmediately; }
81 
88  bool useDocumentationForLabels() const { return this->UseDocumentationForLabels; }
89 
95  static QWidget* newGroupLabelWidget(const QString& label, QWidget* parentWidget,
96  const QList<QWidget*>& buttons = QList<QWidget*>());
97 
103  static bool useDocumentationForLabels(vtkSMProxy* proxy);
104 
106  {
110  USE_LONG_HELP
111  };
112 
117  static QString documentationText(
118  vtkSMProperty* property, DocumentationType type = USE_DESCRIPTION);
119 
124  static QString documentationText(vtkSMProxy* property, DocumentationType type = USE_DESCRIPTION);
125 
131  static DocumentationType showProxyDocumentationInPanel(vtkSMProxy* proxy);
132 
133 Q_SIGNALS:
138  void changeAvailable();
139 
144  void changeFinished();
145 
150  void restartRequired();
151 
152 public Q_SLOTS:
159  bool filterWidgets(bool show_advanced = false, const QString& filterText = QString());
160 
164  void apply() const;
165 
169  void reset() const;
170 
174  void setView(pqView*);
175 
180  void updatePanel();
181 
186  virtual bool restoreDefaults();
187 
191  void saveAsDefaults();
192 
196  static pqPropertyWidget* createWidgetForProperty(
197  vtkSMProperty* property, vtkSMProxy* proxy, QWidget* parentObj);
198 
199 protected:
200  void showEvent(QShowEvent* event) override;
201  void hideEvent(QHideEvent* event) override;
202 
203 private Q_SLOTS:
208  void onChangeFinished();
209 
210 private:
214  void constructor(vtkSMProxy* proxy, const QStringList& properties, bool showHeadersFooters,
215  QWidget* parent, Qt::WindowFlags flags);
216 
220  void createWidgets(const QStringList& properties = QStringList());
221 
225  void createPropertyWidgets(const QStringList& properties = QStringList());
226 
230  void create3DWidgets();
231 
232 private:
233  Q_DISABLE_COPY(pqProxyWidget)
234 
235  bool ApplyChangesImmediately;
236  bool UseDocumentationForLabels;
237  bool ShowHeadersFooters = false;
238  class pqInternals;
239  pqInternals* Internals;
240 };
241 
242 #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:80
bool useDocumentationForLabels() const
When this is true, the panel uses a descriptive layout where the documentation for properties is used...
Definition: pqProxyWidget.h:88
superclass for all SM properties
This is a PQ abstraction of a generic view module.
Definition: pqView.h:54
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:152
value
pqProxyWidget represents a panel for a vtkSMProxy.
Definition: pqProxyWidget.h:57