pqProxyWidgetItem.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
3 #include <QObject>
4 
5 #include <QPointer> // for QPointer members
6 
7 class pqPropertyWidget;
8 class pqProxyWidget;
9 class vtkSMProxy;
10 
11 class QFrame;
12 class QGridLayout;
13 
23 class pqProxyWidgetItem : public QObject
24 {
25  typedef QObject Superclass;
26 
27 public:
28  ~pqProxyWidgetItem() override;
29 
33  static pqProxyWidgetItem* newItem(pqPropertyWidget* widget, const QString& label, bool advanced,
34  bool informationOnly, const QStringList& searchTags, pqProxyWidget* parentObj);
35 
41  static pqProxyWidgetItem* newGroupItem(pqPropertyWidget* widget, const QString& label,
42  bool showSeparators, bool advanced, const QStringList& searchTags, pqProxyWidget* parentObj);
43 
48  static pqProxyWidgetItem* newMultiItemGroupItem(const QString& group_label,
49  pqPropertyWidget* widget, const QString& widget_label, bool showSeparators, bool advanced,
50  bool informationOnly, const QStringList& searchTags, pqProxyWidget* parentObj);
51 
55  static QFrame* newHLine(QWidget* parent);
56 
61  static QWidget* newGroupSeparator(QWidget* parent);
62 
67 
72  void appendToDefaultVisibilityForRepresentations(const QString& repr);
73 
77  void apply() const;
79  void reset() const;
80  void select() const;
81  void deselect() const;
83 
88  bool canShowWidget(bool show_advanced, const QString& filterText, vtkSMProxy* proxy) const;
89 
94  bool enableWidget() const;
95 
99  bool isAdvanced(vtkSMProxy* proxy) const;
100 
105  void show(const pqProxyWidgetItem* prevVisibleItem, bool enabled = true,
106  bool show_advanced = false) const;
107 
111  void hide() const;
112 
118  void appendToLayout(QGridLayout* glayout, bool singleColumn);
119 
120 private:
121  Q_DISABLE_COPY(pqProxyWidgetItem);
122 
123  // Regular expression with tags used to match search text.
124  QStringList SearchTags;
125  bool Advanced = false;
126  bool InformationOnly = false;
127 
128  QPointer<QWidget> GroupHeader;
129  QPointer<QWidget> GroupFooter;
130  QPointer<QWidget> LabelWidget;
131  QPointer<pqPropertyWidget> PropertyWidget;
132  QStringList DefaultVisibilityForRepresentations;
133  bool Group = false;
134  QString GroupTag;
135 
137  QObject* parentObj, bool advanced, bool informationOnly, const QStringList& searchTags);
138 };
bool enableWidget() const
Return true if the widget should be enabled.
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
static QWidget * newGroupSeparator(QWidget *parent)
Create a separator for a new Group widget.
bool isAdvanced(vtkSMProxy *proxy) const
Return true if the property is advanced.
void reset() const
Utility methods forwarded to the Property widget.
pqPropertyWidget * propertyWidget() const
Return the underlying pqPropertyWidget.
void appendToDefaultVisibilityForRepresentations(const QString &repr)
Add representation to the list of representations that forces visibility to be "default", bypassing the "Advanced" option.
static pqProxyWidgetItem * newMultiItemGroupItem(const QString &group_label, pqPropertyWidget *widget, const QString &widget_label, bool showSeparators, bool advanced, bool informationOnly, const QStringList &searchTags, pqProxyWidget *parentObj)
Creates a new item for a property group with several widgets (for individual properties in the group)...
static QFrame * newHLine(QWidget *parent)
Create a simple horizontal line.
pqProxyWidgetItem represents a single widget for a property/properties.
static pqProxyWidgetItem * newItem(pqPropertyWidget *widget, const QString &label, bool advanced, bool informationOnly, const QStringList &searchTags, pqProxyWidget *parentObj)
Create a simple pqProxyWidgetItem.
void apply() const
Utility methods forwarded to the Property widget.
void appendToLayout(QGridLayout *glayout, bool singleColumn)
Adds widgets to the layout.
void hide() const
Hide the underlying widgets.
~pqProxyWidgetItem() override
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
enabled
pqProxyWidget represents a panel for a vtkSMProxy.
Definition: pqProxyWidget.h:28
void show(const pqProxyWidgetItem *prevVisibleItem, bool enabled=true, bool show_advanced=false) const
Show the underlying widgets Separators are shown only when needed (i.e.
static pqProxyWidgetItem * newGroupItem(pqPropertyWidget *widget, const QString &label, bool showSeparators, bool advanced, const QStringList &searchTags, pqProxyWidget *parentObj)
Creates a new item for a property group.
void deselect() const
Utility methods forwarded to the Property widget.
void select() const
Utility methods forwarded to the Property widget.
bool canShowWidget(bool show_advanced, const QString &filterText, vtkSMProxy *proxy) const
Return true if the widget should be shown in the current configuration: advanced mode, filtering text and optional decorators.