From c4981f28a6ada0571276bcdf75c6171e1638678d Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Sat, 12 Jul 2014 14:24:25 +0200 Subject: Add step size in our SpinBox delegates For the Set point spinbox, it was kinda hard just stepping by the default 1.0, so setting it to step by 0.1 makes much more sense. The int SpinBox got a step size parameter for consistency. Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/modeldelegates.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'qt-ui/modeldelegates.h') diff --git a/qt-ui/modeldelegates.h b/qt-ui/modeldelegates.h index bb948d32d..bb9854eb5 100644 --- a/qt-ui/modeldelegates.h +++ b/qt-ui/modeldelegates.h @@ -91,21 +91,23 @@ public: class SpinBoxDelegate : public QStyledItemDelegate { Q_OBJECT public: - SpinBoxDelegate(int min, int max, QObject *parent = 0); + SpinBoxDelegate(int min, int max, int step, QObject *parent = 0); virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: int min; int max; + int step; }; class DoubleSpinBoxDelegate : public QStyledItemDelegate { Q_OBJECT public: - DoubleSpinBoxDelegate(double min, double max, QObject *parent = 0); + DoubleSpinBoxDelegate(double min, double max, double step, QObject *parent = 0); virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const; private: double min; double max; + double step; }; #endif // MODELDELEGATES_H -- cgit v1.2.3-70-g09d2