pqMaterialAttributesDelegate.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 pqMaterialAttributesDelegate_h
5 #define pqMaterialAttributesDelegate_h
6 
8 #include <QStyledItemDelegate>
9 
14 {
15  Q_OBJECT
16  typedef QStyledItemDelegate Superclass;
17 
18 public:
19  pqMaterialAttributesDelegate(QObject* parent = nullptr);
20  ~pqMaterialAttributesDelegate() override = default;
21 
22  void paint(
23  QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
24 
29  QWidget* createEditor(
30  QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
31 
35  void setEditorData(QWidget* editor, const QModelIndex& index) const override
36  {
37  Q_UNUSED(editor);
38  Q_UNUSED(index);
39  };
40 
44  void setModelData(
45  QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
46 
47 protected:
51  QWidget* createPropertiesEditor(QVariantList list, QWidget* parent) const;
52 
56  QVariantList getPropertiesFromEditor(QWidget* editor) const;
57 
58 private:
59  Q_DISABLE_COPY(pqMaterialAttributesDelegate)
60 };
61 
62 #endif
#define PQAPPLICATIONCOMPONENTS_EXPORT
pqMaterialAttributesDelegate is used to customize material attributes table view. ...
void setEditorData(QWidget *editor, const QModelIndex &index) const override
do nothing, everything is handled in createEditor method
index