Sort/filter proxy model for the Advanced Preferences pane.
More...
#include <pref_models.h>
|
| | AdvancedPrefsModel (QObject *parent=Q_NULLPTR) |
| | Construct an AdvancedPrefsModel.
|
| virtual bool | filterAcceptsRow (int sourceRow, const QModelIndex &sourceParent) const override |
| | Determine whether a source row should be included in the view.
|
| void | setFilter (const QString &filter) |
| | Set the text filter applied to preference names and values.
|
| void | setShowChangedValues (bool show_changed_values) |
| | Restrict the view to preferences that differ from their defaults.
|
| QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override |
| | Return the column header label.
|
| QVariant | data (const QModelIndex &index, int role) const override |
| | Return data for index under role.
|
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| | Return the item flags for index.
|
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| | Write value to the preference at index.
|
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| | Return the number of columns in this model.
|
| void | setFirstColumnSpanned (QTreeView *tree, const QModelIndex &index=QModelIndex()) |
| | Mark module-level rows as spanning all columns in tree.
|
Sort/filter proxy model for the Advanced Preferences pane.
◆ AdvancedPrefsModelColumn
Column indices for the Advanced preferences view.
| Enumerator |
|---|
| colName | Preference name.
|
| colStatus | Default / changed status indicator.
|
| colType | Preference type string.
|
| colValue | Current preference value.
|
| colLast | Sentinel — total column count.
|
◆ AdvancedPrefsModel()
| AdvancedPrefsModel::AdvancedPrefsModel |
( |
QObject * | parent = Q_NULLPTR | ) |
|
|
explicit |
◆ columnCount()
| int AdvancedPrefsModel::columnCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
Return the number of columns in this model.
- Parameters
-
| parent | Unused; present for API compatibility. |
- Returns
- Always
colLast.
◆ data()
| QVariant AdvancedPrefsModel::data |
( |
const QModelIndex & | index, |
|
|
int | role ) const |
|
override |
Return data for index under role.
- Parameters
-
| index | The proxy model index to query. |
| role | The data role. |
- Returns
- The requested data, or an invalid QVariant if unavailable.
◆ filterAcceptItem()
| bool AdvancedPrefsModel::filterAcceptItem |
( |
PrefsItem & | item | ) |
const |
|
protected |
Test whether a single PrefsItem passes the current filters.
- Parameters
-
- Returns
- true if
item should be included in the filtered view.
◆ filterAcceptsRow()
| bool AdvancedPrefsModel::filterAcceptsRow |
( |
int | sourceRow, |
|
|
const QModelIndex & | sourceParent ) const |
|
overridevirtual |
Determine whether a source row should be included in the view.
A row is accepted if it belongs to the Advanced subtree of the source model and passes the current text filter and changed-values filter.
- Parameters
-
| sourceRow | The row index in the source model. |
| sourceParent | The parent index in the source model. |
- Returns
- true if the row should be shown; false to hide it.
◆ flags()
| Qt::ItemFlags AdvancedPrefsModel::flags |
( |
const QModelIndex & | index | ) |
const |
|
override |
Return the item flags for index.
Marks editable preference items with Qt::ItemIsEditable.
- Parameters
-
| index | The proxy model index to query. |
- Returns
- The item flags for the preference at
index.
◆ headerData()
| QVariant AdvancedPrefsModel::headerData |
( |
int | section, |
|
|
Qt::Orientation | orientation, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
Return the column header label.
- Parameters
-
| section | Column index. |
| orientation | Must be Qt::Horizontal. |
| role | The data role; typically Qt::DisplayRole. |
- Returns
- The header label for
section, or an invalid QVariant.
◆ setData()
| bool AdvancedPrefsModel::setData |
( |
const QModelIndex & | index, |
|
|
const QVariant & | value, |
|
|
int | role = Qt::EditRole ) |
|
override |
Write value to the preference at index.
- Parameters
-
| index | The proxy model index of the preference to update. |
| value | The new value to apply. |
| role | The data role; only Qt::EditRole is handled. |
- Returns
- true if the value was successfully applied; false otherwise.
◆ setFilter()
| void AdvancedPrefsModel::setFilter |
( |
const QString & | filter | ) |
|
Set the text filter applied to preference names and values.
Rows whose name or value do not contain filter (case-insensitive) are hidden. An empty string shows all rows.
- Parameters
-
| filter | The filter string to apply. |
◆ setFirstColumnSpanned()
| void AdvancedPrefsModel::setFirstColumnSpanned |
( |
QTreeView * | tree, |
|
|
const QModelIndex & | index = QModelIndex() ) |
Mark module-level rows as spanning all columns in tree.
Keep the internals of model hidden from tree.
- Parameters
-
| tree | The QTreeView to update. |
| index | The root index from which to start; defaults to the model root. |
◆ setShowChangedValues()
| void AdvancedPrefsModel::setShowChangedValues |
( |
bool | show_changed_values | ) |
|
Restrict the view to preferences that differ from their defaults.
- Parameters
-
| show_changed_values | true to show only changed preferences; false to show all preferences. |
The documentation for this class was generated from the following files:
- /builds/wireshark/wireshark/ui/qt/models/pref_models.h
- /builds/wireshark/wireshark/ui/qt/models/pref_models.cpp