pqSignalAdaptorSelectionTreeWidget.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 pqSignalAdaptorSelectionTreeWidget_h
5 #define pqSignalAdaptorSelectionTreeWidget_h
6 
7 #include "pqComponentsModule.h"
8 #include <QList>
9 #include <QObject>
10 #include <QVariant>
11 
12 class QTreeWidget;
13 class vtkSMProperty;
14 class QTreeWidgetItem;
15 
29 {
30  Q_OBJECT
31  Q_PROPERTY(QList<QList<QVariant>> values READ values WRITE setValues)
32 public:
38  pqSignalAdaptorSelectionTreeWidget(QTreeWidget* treeWidget, vtkSMProperty* property);
39 
41 
47  QList<QList<QVariant>> values() const;
48 
57  void setItemCreatorFunction(QTreeWidgetItem*(fptr)(QTreeWidget*, const QStringList&))
58  {
59  this->ItemCreatorFunctionPtr = fptr;
60  }
61 
62 Q_SIGNALS:
66  void valuesChanged();
67 
68 public Q_SLOTS:
75  void setValues(const QList<QList<QVariant>>& values);
76 
77 private Q_SLOTS:
82  void domainChanged();
83 
84 private: // NOLINT(readability-redundant-access-specifiers)
86 
87  class pqInternal;
88  pqInternal* Internal;
89 
90  QTreeWidgetItem* (*ItemCreatorFunctionPtr)(QTreeWidget*, const QStringList&);
91 };
92 
93 #endif
#define PQCOMPONENTS_EXPORT
superclass for all SM properties
void setItemCreatorFunction(QTreeWidgetItem *(fptr)(QTreeWidget *, const QStringList &))
This adaptor create QTreeWidgetItem instances by default when new entries are to be shown in the widg...
pqSignalAdaptorSelectionTreeWidget has two roles.