12345678910111213141516171819202122232425262728 |
- #ifndef SPINBOXDELEGATE_H
- #define SPINBOXDELEGATE_H
- #include <QList>
- #include <qstyleditemdelegate.h>
- class SpinBoxDelegate : public QStyledItemDelegate
- {
- Q_OBJECT
- private:
- QStringList list;
- public:
- SpinBoxDelegate(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;
- signals:
- void dataChanged(const QModelIndex &index) const;
- };
- #endif // SPINBOXDELEGATE_H
|