#ifndef MATRIXTABLEITEMDELEGATE_H #define MATRIXTABLEITEMDELEGATE_H #include #include class QAbstractButton; class SchemeBar : public QDialog { Q_OBJECT public: SchemeBar(const QString &lLabel, const QString &rLabel, const QStringList &vlist, QWidget *parent = nullptr); private slots: void barClicked(QAbstractButton *btn); signals: void setValue(QString val); private: QString leftLabel; QString rightLabel; QStringList barValueList; }; class MatrixTableItemDelegate : public QStyledItemDelegate { Q_OBJECT public: explicit MatrixTableItemDelegate(QWidget *parent = nullptr); signals: // QAbstractItemDelegate interface public: QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE; void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE; }; #endif // MATRIXTABLEITEMDELEGATE_H