The NumericDelegate class provides a double spin box editor for numeric data in a view.
More...
#include <numericdelegate.h>
|
| | NumericDelegate (QWidget *parent=nullptr, double maxValue=1000000000.0, double minValue=-1000000000.0, int decimals=3, double stepSize=0.1, double value=0) |
| | Constructor for the NumericDelegate class.
|
| |
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override |
| | Creates an editor widget for the given parent, style option, and model index.
|
| |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override |
| | Sets the model data based on the data of the editor widget.
|
| |
The NumericDelegate class provides a double spin box editor for numeric data in a view.
◆ NumericDelegate()
| NumericDelegate::NumericDelegate |
( |
QWidget * |
parent = nullptr, |
|
|
double |
maxValue = 1000000000.0, |
|
|
double |
minValue = -1000000000.0, |
|
|
int |
decimals = 3, |
|
|
double |
stepSize = 0.1, |
|
|
double |
value = 0 |
|
) |
| |
|
inline |
Constructor for the NumericDelegate class.
- Parameters
-
| parent | The parent widget. |
| maxValue | The maximum value for the double spin box. |
| minValue | The minimum value for the double spin box. |
| decimals | The number of decimal places for the double spin box. |
| stepSize | The step size for the double spin box. |
◆ createEditor()
| QWidget * NumericDelegate::createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
inlineoverride |
Creates an editor widget for the given parent, style option, and model index.
- Parameters
-
| parent | The parent widget. |
| option | The style options for the item. |
| index | The model index of the item. |
- Returns
- The created editor widget.
◆ setModelData()
| void NumericDelegate::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
inlineoverride |
Sets the model data based on the data of the editor widget.
- Parameters
-
| editor | The editor widget. |
| model | The abstract item model. |
| index | The model index of the item. |