A delegate for choosing numeric values within a specified range in item views.
More...
#include <numeric_value_chooser_delegate.h>
|
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| | Creates the editor widget for the item.
|
| |
| void | setEditorData (QWidget *editor, const QModelIndex &index) const |
| | Sets the data to be displayed in the editor widget.
|
| |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| | Saves the data from the editor widget back into the model.
|
| |
A delegate for choosing numeric values within a specified range in item views.
◆ NumericValueChooserDelegate()
| NumericValueChooserDelegate::NumericValueChooserDelegate |
( |
int |
min = 0, |
|
|
int |
max = 0, |
|
|
QObject * |
parent = 0 |
|
) |
| |
Constructs a new NumericValueChooserDelegate object.
- Parameters
-
| min | The minimum allowed value. |
| max | The maximum allowed value. |
| parent | The parent object. |
◆ createEditor()
| QWidget * NumericValueChooserDelegate::createEditor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
protected |
Creates the editor widget for the item.
- Parameters
-
| parent | The parent widget. |
| option | The style option for the item. |
| index | The model index of the item being edited. |
- Returns
- A pointer to the created editor widget.
◆ setDefaultValue()
| void NumericValueChooserDelegate::setDefaultValue |
( |
int |
defValue, |
|
|
QVariant |
defaultReturn |
|
) |
| |
Sets the default value and the default return variant.
- Parameters
-
| defValue | The default numeric value. |
| defaultReturn | The default variant to return. |
◆ setEditorData()
| void NumericValueChooserDelegate::setEditorData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
protected |
Sets the data to be displayed in the editor widget.
- Parameters
-
| editor | The editor widget. |
| index | The model index of the item being edited. |
◆ setMinMaxRange()
| void NumericValueChooserDelegate::setMinMaxRange |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
Sets the minimum and maximum allowed range for the chooser.
- Parameters
-
| min | The minimum value. |
| max | The maximum value. |
◆ setModelData()
| void NumericValueChooserDelegate::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| const |
|
protected |
Saves the data from the editor widget back into the model.
- Parameters
-
| editor | The editor widget. |
| model | The data model. |
| index | The model index of the item being edited. |
The documentation for this class was generated from the following files: