diff options
Diffstat (limited to 'qt-ui/modeldelegates.h')
-rw-r--r-- | qt-ui/modeldelegates.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/qt-ui/modeldelegates.h b/qt-ui/modeldelegates.h index e2b705e17..7679766e9 100644 --- a/qt-ui/modeldelegates.h +++ b/qt-ui/modeldelegates.h @@ -88,4 +88,24 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; }; +class SpinBoxDelegate : public QStyledItemDelegate { + Q_OBJECT +public: + SpinBoxDelegate(int min, int max, QObject *parent = 0); + virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; +private: + int min; + int max; +}; + +class DoubleSpinBoxDelegate : public QStyledItemDelegate { + Q_OBJECT +public: + DoubleSpinBoxDelegate(qreal min, qreal max, QObject *parent = 0); + virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; +private: + int min; + int max; +}; + #endif // MODELDELEGATES_H |