pqScalarValueListPropertyWidget.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 pqScalarValueListPropertyWidget_h
5 #define pqScalarValueListPropertyWidget_h
6 
7 #include "pqPropertyWidget.h"
8 
9 #include "vtkParaViewDeprecation.h" // for PARAVIEW_DEPRECATED_IN_5_12_0
10 
11 #include <QVariant>
12 #include <string>
13 #include <vector>
14 
15 class QListWidgetItem;
16 class vtkPVXMLElement;
20 
29 {
30  Q_OBJECT
31  Q_PROPERTY(QVariantList scalars READ scalars WRITE setScalars)
32 
33  typedef pqPropertyWidget Superclass;
34 
35 public:
37  vtkSMProperty* property, vtkSMProxy* proxy, QWidget* parent = nullptr);
39 
40  void setScalars(const QVariantList& scalars);
41  QVariantList scalars() const;
42 
44 
48  void setRangeDomain(vtkSMDoubleRangeDomain* smRangeDomain);
49  void setRangeDomain(vtkSMIntRangeDomain* smRangeDomain);
50  void setRangeDomain(vtkSMTimeStepsDomain* timestepsDomain);
52 
53  void setShowLabels(bool);
54  void setLabels(const std::vector<std::string>& labels);
55 
57  "vector of const char* is not memory safe, use std::string version instead")
58  void setLabels(std::vector<const char*>&);
59 
60 Q_SIGNALS:
61  void scalarsChanged();
62 
63 private Q_SLOTS:
64  void smRangeModified();
65 
69  void add();
70  void addRange();
71  void remove();
72  void removeAll();
73  void editPastLastRow();
74  void restoreDefaults();
75 
76 private: // NOLINT(readability-redundant-access-specifiers)
77  Q_DISABLE_COPY(pqScalarValueListPropertyWidget)
78 
79  bool getRange(double& range_min, double& range_max);
80  bool getRange(int& range_min, int& range_max);
81 
82  class pqInternals;
83  pqInternals* Internals;
84 };
85 
86 #endif // pqScalarValueListPropertyWidget_h
type specific extension to vtkSMRangeDomainTemplate for ints.
pqPropertyWidget represents a widget created for each property of a proxy on the pqPropertiesPanel (f...
#define PARAVIEW_DEPRECATED_IN_5_12_0(reason)
type specific extension to vtkSMRangeDomainTemplate for doubles.
#define PQCOMPONENTS_EXPORT
pqScalarValueListPropertyWidget provides a table widget to which users are add values e...
superclass for all SM properties
A domain providing timesteps from its "Input" property.
proxy for a VTK object(s) on a server
Definition: vtkSMProxy.h:140
This is used by vtkPVXMLParser to represent an XML document starting at the root element.
#define const
Definition: zconf.h:238