Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
pref_delegate.h
Go to the documentation of this file.
1
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;
44
51 void setEditorData(QWidget *editor, const QModelIndex &index) const;
52
60 void setModelData(QWidget *editor, QAbstractItemModel *model,
61 const QModelIndex &index) const;
62
63private:
70 PrefsItem *indexToPref(const QModelIndex &index) const;
71};
72
73#endif // PREF_DELEGATE_H
Item delegate providing in-place editors for the Advanced Preferences table.
Definition pref_delegate.h:26
void setEditorData(QWidget *editor, const QModelIndex &index) const
Populate the editor with the current preference value.
Definition pref_delegate.cpp:58
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
Create an editor widget appropriate for the preference at index.
Definition pref_delegate.cpp:27
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Write the editor's current value back to the model.
Definition pref_delegate.cpp:72
A single node in the PrefsModel tree.
Definition pref_models.h:136