The IntNumericDelegate class provides a spin box editor for integer numeric data in a view.
More...
#include <intnumericdelegate.h>
|
| IntNumericDelegate (QWidget *parent=nullptr, int maxValue=1000000000, int minValue=-1000000000, int stepSize=1, int value=0) |
| Constructor for the IntNumericDelegate 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 IntNumericDelegate class provides a spin box editor for integer numeric data in a view.
◆ IntNumericDelegate()
IntNumericDelegate::IntNumericDelegate |
( |
QWidget * |
parent = nullptr , |
|
|
int |
maxValue = 1000000000 , |
|
|
int |
minValue = -1000000000 , |
|
|
int |
stepSize = 1 , |
|
|
int |
value = 0 |
|
) |
| |
|
inline |
Constructor for the IntNumericDelegate class.
- Parameters
-
parent | The parent widget. |
maxValue | The maximum value for the spin box. |
minValue | The minimum value for the spin box. |
stepSize | The step size for the spin box. |
◆ createEditor()
QWidget * IntNumericDelegate::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 IntNumericDelegate::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. |