1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef EXDATAVIEWDELEGATE_H
- #define EXDATAVIEWDELEGATE_H
- #include <QDialog>
- #include <QStyledItemDelegate>
- 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 EXDataTableComboDelegate : public QStyledItemDelegate
- {
- public:
- explicit EXDataTableComboDelegate(QObject *parent = nullptr);
- QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
- void setEditorData(QWidget *editor, const QModelIndex &index) const override;
- void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
- void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
- const QModelIndex &index) const override;
- private:
- QStringList m_items;
- };
- #endif // EXDATAVIEWDELEGATE_H
|