Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
NumericValueChooserDelegate Class Reference

A delegate for choosing numeric values within a specified range in item views. More...

#include <numeric_value_chooser_delegate.h>

Inheritance diagram for NumericValueChooserDelegate:

Public Member Functions

 NumericValueChooserDelegate (int min=0, int max=0, QObject *parent=0)
 Constructs a new NumericValueChooserDelegate object.
 ~NumericValueChooserDelegate ()
 Destroys the NumericValueChooserDelegate object.
void setMinMaxRange (int min, int max)
 Sets the minimum and maximum allowed range for the chooser.
void setDefaultValue (int defValue, QVariant defaultReturn)
 Sets the default value and the default return variant.

Protected Member Functions

QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Creates the editor widget for the item.
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Sets the data to be displayed in the editor widget.
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Saves the data from the editor widget back into the model.

Detailed Description

A delegate for choosing numeric values within a specified range in item views.

Constructor & Destructor Documentation

◆ NumericValueChooserDelegate()

NumericValueChooserDelegate::NumericValueChooserDelegate ( int min = 0,
int max = 0,
QObject * parent = 0 )

Constructs a new NumericValueChooserDelegate object.

Parameters
minThe minimum allowed value.
maxThe maximum allowed value.
parentThe parent object.

Member Function Documentation

◆ createEditor()

QWidget * NumericValueChooserDelegate::createEditor ( QWidget * parent,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
overrideprotected

Creates the editor widget for the item.

Parameters
parentThe parent widget.
optionThe style option for the item.
indexThe 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
defValueThe default numeric value.
defaultReturnThe default variant to return.

◆ setEditorData()

void NumericValueChooserDelegate::setEditorData ( QWidget * editor,
const QModelIndex & index ) const
overrideprotected

Sets the data to be displayed in the editor widget.

Parameters
editorThe editor widget.
indexThe 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
minThe minimum value.
maxThe maximum value.

◆ setModelData()

void NumericValueChooserDelegate::setModelData ( QWidget * editor,
QAbstractItemModel * model,
const QModelIndex & index ) const
overrideprotected

Saves the data from the editor widget back into the model.

Parameters
editorThe editor widget.
modelThe data model.
indexThe model index of the item being edited.

The documentation for this class was generated from the following files: