/*============================================================================ ** ** Project/Product : ** Filename : spinboxdelegate.h ** Author(s) : DDP ** ** Description : A delgated widget to assist in the editing of time items ** within a table ** ** ***==========================================================================*/ #ifndef SPINDELEGATE_H #define SPINDELEGATE_H #include #include #include #include #include class SpinBoxDelegate : public QItemDelegate { Q_OBJECT public: SpinBoxDelegate(int minvalue = 0, int maxvalue = 0, QObject *parent = 0); QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; int min_value; int max_value; void setEditorData(QWidget *editor, const QModelIndex &index) const; void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const; void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const; }; #endif