Base class for preference editor delegates used in the preferences tree view.
More...
#include <wireshark_preference.h>
|
| Q_INVOKABLE | WiresharkPreference (QObject *parent=Q_NULLPTR) |
| | Constructs a WiresharkPreference with no associated PrefsItem.
|
| |
| virtual QWidget * | editor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) |
| | Creates and returns an editor widget for the preference at index.
|
| |
| virtual void | setData (QWidget *editor, const QModelIndex &index) |
| | Populates the editor widget with the current preference value from the model at index.
|
| |
| virtual void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) |
| | Writes the editor's current value back to the model.
|
| |
| void | setPrefsItem (PrefsItem *item) |
| | Associates a PrefsItem with this preference editor.
|
| |
Base class for preference editor delegates used in the preferences tree view.
Subclasses implement editor(), setData(), and setModelData() to provide type-specific inline editors (e.g. spin boxes, combo boxes, colour pickers) for each preference type.
◆ WiresharkPreference()
| WiresharkPreference::WiresharkPreference |
( |
QObject * |
parent = Q_NULLPTR | ) |
|
|
explicit |
◆ editor()
| QWidget * WiresharkPreference::editor |
( |
QWidget * |
parent, |
|
|
const QStyleOptionViewItem & |
option, |
|
|
const QModelIndex & |
index |
|
) |
| |
|
virtual |
Creates and returns an editor widget for the preference at index.
- Parameters
-
| parent | Parent widget for the created editor. |
| option | Style options for the cell being edited. |
| index | Model index of the preference cell. |
- Returns
- Pointer to the newly created editor widget, or
nullptr if no inline editor is provided by this preference type.
Reimplemented in StringPreference, EnumPreference, RangePreference, ColorPreference, BoolPreference, PasswordPreference, SaveFilePreference, OpenFilePreference, DirNamePreference, and UatPreference.
◆ prefsItem()
| PrefsItem * WiresharkPreference::prefsItem |
( |
| ) |
const |
|
protected |
Returns the PrefsItem associated with this preference editor.
- Returns
- Pointer to the associated PrefsItem, or
nullptr if none has been set.
◆ setData()
| void WiresharkPreference::setData |
( |
QWidget * |
editor, |
|
|
const QModelIndex & |
index |
|
) |
| |
|
virtual |
◆ setModelData()
| void WiresharkPreference::setModelData |
( |
QWidget * |
editor, |
|
|
QAbstractItemModel * |
model, |
|
|
const QModelIndex & |
index |
|
) |
| |
|
virtual |
◆ setPrefsItem()
| void WiresharkPreference::setPrefsItem |
( |
PrefsItem * |
item | ) |
|
Associates a PrefsItem with this preference editor.
- Parameters
-
| item | Pointer to the PrefsItem this editor operates on. |
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/manager/wireshark_preference.h
- /builds/wireshark/wireshark/ui/qt/manager/wireshark_preference.cpp