47 #ifndef _MIRA_SPINBOXDELEGATE_H_ 48 #define _MIRA_SPINBOXDELEGATE_H_ 50 #include <QStyledItemDelegate> 51 #include <QDoubleSpinBox> 59 double maxRange,
double step,
60 double defvalue,
const QString& suffix =
"",
61 bool buttons =
true,
bool readonly =
false,
62 unsigned int decimals = 2);
65 int defvalue,
const QString& suffix =
"",
66 bool buttons =
true,
bool readonly =
false);
85 const QString& suffix =
"",
bool buttons =
true,
unsigned int decimals = 2);
86 void setRange(
double minRange,
double maxRange,
double step);
96 QWidget *
createEditor(QWidget *parent,
const QStyleOptionViewItem &option,
97 const QModelIndex &index)
const;
99 void setEditorData(QWidget *editor,
const QModelIndex &index)
const;
100 void setModelData(QWidget *editor, QAbstractItemModel *model,
101 const QModelIndex &index)
const;
104 const QModelIndex &index)
const;
106 QString
displayText(
const QVariant &value,
const QLocale &locale)
const;
115 unsigned int mDecimals;
void setSuffix(const QString &suffix)
Delegate for a QTableWidgetItem (or any model-view item for that matter).
Definition: SpinBoxDelegate.h:74
void setEditorData(QWidget *editor, const QModelIndex &index) const
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
QDoubleSpinBox * createDoubleSpinBox(QWidget *parent, double minRange, double maxRange, double step, double defvalue, const QString &suffix="", bool buttons=true, bool readonly=false, unsigned int decimals=2)
QSpinBox * createSpinBox(QWidget *parent, int min, int max, int step, int defvalue, const QString &suffix="", bool buttons=true, bool readonly=false)
void setDefaultValue(double defvalue)
QString displayText(const QVariant &value, const QLocale &locale) const
void setRange(double minRange, double maxRange, double step)
SpinBoxDelegate(QObject *parent=0)
void setDecimals(unsigned int decimals)
PropertyHint step(const T &step)
Sets the attribute "step" to the specified value.
Definition: PropertyHint.h:265
virtual ~SpinBoxDelegate()
void setSpinBoxFormat(double minRange, double maxRange, double step, double defvalue, const QString &suffix="", bool buttons=true, unsigned int decimals=2)
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, 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
void setShowButtons(bool show)