Wireshark 4.7.3
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
pref_delegate.h
Go to the documentation of this file.
1
11
12#ifndef PREF_DELEGATE_H
13#define PREF_DELEGATE_H
14
15#include <config.h>
16
18
19#include <QStyledItemDelegate>
20#include <QModelIndex>
21
25class AdvancedPrefDelegate : public QStyledItemDelegate
26{
27public:
32 AdvancedPrefDelegate(QObject *parent = 0);
33
42 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
43 const QModelIndex &index) const override;
44
51 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
52
60 void setModelData(QWidget *editor, QAbstractItemModel *model,
61 const QModelIndex &index) const override;
62
63private:
70 PrefsItem *indexToPref(const QModelIndex &index) const;
71};
72
73#endif // PREF_DELEGATE_H
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Populate the editor with the current preference value.
Definition pref_delegate.cpp:58
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Write the editor's current value back to the model.
Definition pref_delegate.cpp:72
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Create an editor widget appropriate for the preference at index.
Definition pref_delegate.cpp:27
AdvancedPrefDelegate(QObject *parent=0)
Construct an AdvancedPrefDelegate.
Definition pref_delegate.cpp:17
A single node in the PrefsModel tree.
Definition pref_models.h:136