#ifndef SPINBOXDELEGATE_H #define SPINBOXDELEGATE_H #include #include 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