pqComboBoxDomain.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 
5 #ifndef pqComboBoxDomain_h
6 #define pqComboBoxDomain_h
7 
8 #include "pqComponentsModule.h"
9 #include <QObject>
10 
11 class QComboBox;
12 class QIcon;
13 class vtkSMDomain;
14 class vtkSMProperty;
15 
22 class PQCOMPONENTS_EXPORT pqComboBoxDomain : public QObject
23 {
24  Q_OBJECT
25 public:
32  pqComboBoxDomain(QComboBox* p, vtkSMProperty* prop, vtkSMDomain* domain = nullptr);
33  ~pqComboBoxDomain() override;
34 
35  // explicitly trigger a domain change.
36  // simply calls internalDomainChanged();
37  void forceDomainChanged() { this->internalDomainChanged(); }
38 
43  void addString(const QString&);
44  void insertString(int, const QString&);
45  void removeString(const QString&);
46  void removeAllStrings();
47 
48  vtkSMProperty* getProperty() const;
49  vtkSMDomain* getDomain() const;
50  const QStringList& getUserStrings() const;
51 
56  static QIcon getIcon(int fieldAssociation);
57 
58 public Q_SLOTS: // NOLINT(readability-redundant-access-specifiers)
59  void domainChanged();
60 protected Q_SLOTS:
61  virtual void internalDomainChanged();
62 
63 protected: // NOLINT(readability-redundant-access-specifiers)
64  void markForUpdate(bool mark);
65 
66  class pqInternal;
67  pqInternal* Internal;
68 };
69 
70 #endif
combo box domain observes the domain for a combo box and updates accordingly.
#define PQCOMPONENTS_EXPORT
superclass for all SM properties
represents the possible values a property can have
Definition: vtkSMDomain.h:37
pqInternal * Internal