Loading...
Searching...
No Matches
ValueItemDelegate.hpp
1#pragma once
2#include <QSet>
3#include <QStyledItemDelegate>
4
5#include <score_plugin_scenario_export.h>
6
7namespace Scenario
8{
16inline constexpr int OssiaValueRole = Qt::UserRole + 41;
17
26class SCORE_PLUGIN_SCENARIO_EXPORT ValueItemDelegate final : public QStyledItemDelegate
27{
28public:
29 explicit ValueItemDelegate(int valueColumn, QObject* parent = nullptr);
31
32private:
33 QWidget* createEditor(
34 QWidget* parent, const QStyleOptionViewItem& option,
35 const QModelIndex& index) const override;
36 void setEditorData(QWidget* editor, const QModelIndex& index) const override;
37 void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index)
38 const override;
39 void updateEditorGeometry(
40 QWidget* editor, const QStyleOptionViewItem& option,
41 const QModelIndex& index) const override;
42
44 void destroyEditor(QWidget* editor, const QModelIndex& index) const override;
45
47 bool owns(QWidget* editor) const noexcept { return m_live.contains(editor); }
48
49 mutable QSet<QWidget*> m_live;
50 int m_column{};
51};
52}
Gives a value column the Device Explorer's editors.
Definition ValueItemDelegate.hpp:27
Main plug-in of score.
Definition score-plugin-dataflow/Dataflow/PortItem.hpp:13
constexpr int OssiaValueRole
The row's value as an ossia::value.
Definition ValueItemDelegate.hpp:16