15 #include <ui/qt/models/tree_model_helpers.h> 17 #include <epan/prefs.h> 19 #include <QSortFilterProxyModel> 29 QString getName()
const {
return name_;}
30 pref_t* getPref()
const {
return pref_;}
31 int getPrefType()
const;
32 int getPrefGUIType()
const;
33 bool isPrefDefault()
const;
34 QString getPrefTypeName()
const;
35 module_t* getModule()
const {
return module_;}
36 QString getModuleName()
const;
37 QString getModuleTitle()
const;
38 void setChanged(
bool changed =
true);
55 explicit PrefsModel(QObject * parent = Q_NULLPTR);
60 static const char* ADVANCED_PREFERENCE_TREE_NAME;
61 static const char* APPEARANCE_PREFERENCE_TREE_NAME;
62 static const char* LAYOUT_PREFERENCE_TREE_NAME;
63 static const char* COLUMNS_PREFERENCE_TREE_NAME;
64 static const char* FONT_AND_COLORS_PREFERENCE_TREE_NAME;
65 static const char* CAPTURE_PREFERENCE_TREE_NAME;
66 static const char* EXPERT_PREFERENCE_TREE_NAME;
67 static const char* FILTER_BUTTONS_PREFERENCE_TREE_NAME;
69 enum PrefsModelColumn {
77 QModelIndex index(
int row,
int column,
78 const QModelIndex & = QModelIndex())
const;
79 QModelIndex parent(
const QModelIndex &)
const;
80 QVariant data(
const QModelIndex &index,
int role)
const;
82 int rowCount(
const QModelIndex &parent = QModelIndex())
const;
83 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
98 enum AdvancedPrefsModelColumn {
106 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const;
108 void setFilter(
const QString& filter);
110 QVariant headerData(
int section, Qt::Orientation orientation,
111 int role = Qt::DisplayRole)
const;
112 QVariant data(
const QModelIndex &index,
int role)
const;
113 Qt::ItemFlags flags(
const QModelIndex &index)
const;
114 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole);
116 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
119 void setFirstColumnSpanned(QTreeView* tree,
const QModelIndex &index = QModelIndex());
122 bool filterAcceptItem(
PrefsItem& item)
const;
136 enum ModulePrefsModelColumn {
141 enum ModulePrefsRoles {
142 ModuleName = Qt::UserRole + 1
145 QVariant data(
const QModelIndex &index,
int role)
const;
146 Qt::ItemFlags flags(
const QModelIndex &index)
const;
147 int columnCount(
const QModelIndex &parent = QModelIndex())
const;
149 virtual bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent)
const;
152 bool lessThan(
const QModelIndex &source_left,
const QModelIndex &source_right)
const;
156 QString advancedPrefName_;
159 extern pref_t *prefFromPrefPtr(
void *pref_ptr);
161 #endif // PREF_MODELS_H Definition: pref_models.h:91
Definition: pref_models.h:50
Definition: prefs-int.h:27
Definition: tree_model_helpers.h:22
Definition: pref_models.h:22
Definition: pref_models.h:129