Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
wireshark_preference.h
Go to the documentation of this file.
1
10#ifndef WIRESHARK_PREFERENCE_H
11#define WIRESHARK_PREFERENCE_H
12
14
15#include <QStyleOptionViewItem>
16#include <QModelIndex>
17#include <QWidget>
18
26class WiresharkPreference : public QObject
27{
28public:
33 explicit Q_INVOKABLE WiresharkPreference(QObject *parent = Q_NULLPTR);
34
43 virtual QWidget *editor(QWidget *parent, const QStyleOptionViewItem &option,
44 const QModelIndex &index);
45
52 virtual void setData(QWidget *editor, const QModelIndex &index);
53
60 virtual void setModelData(QWidget *editor, QAbstractItemModel *model,
61 const QModelIndex &index);
62
67 void setPrefsItem(PrefsItem *item);
68
69protected:
74 PrefsItem *prefsItem() const;
75
76private:
77 PrefsItem *_prefsItem;
78};
79
80#endif // WIRESHARK_PREFERENCE_H
A single node in the PrefsModel tree.
Definition pref_models.h:136
Base class for preference editor delegates used in the preferences tree view.
Definition wireshark_preference.h:27
virtual QWidget * editor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index)
Creates and returns an editor widget for the preference at index.
Definition wireshark_preference.cpp:30
PrefsItem * prefsItem() const
Returns the PrefsItem associated with this preference editor.
Definition wireshark_preference.cpp:43
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index)
Writes the editor's current value back to the model.
Definition wireshark_preference.cpp:36
virtual void setData(QWidget *editor, const QModelIndex &index)
Populates the editor widget with the current preference value from the model at index.
Definition wireshark_preference.cpp:35
void setPrefsItem(PrefsItem *item)
Associates a PrefsItem with this preference editor.
Definition wireshark_preference.cpp:38