List model providing filtered, ranked search results.
More...
#include <settings_search_model.h>
|
| void | rebuildFilter () |
| | Recalculates the filtered index list and ranking.
|
List model providing filtered, ranked search results.
Manages a list of SettingsSearchEntry items. When a filter string is set, entries are scored by relevance and sorted so the best matches appear first. Supports custom roles for accessing entry fields from views and delegates.
◆ Roles
Custom data role for accessing the full entry.
◆ SettingsSearchModel()
| SettingsSearchModel::SettingsSearchModel |
( |
QObject * | parent = nullptr | ) |
|
|
explicit |
◆ data()
| QVariant SettingsSearchModel::data |
( |
const QModelIndex & | index, |
|
|
int | role = Qt::DisplayRole ) const |
|
override |
◆ entryForIndex()
Returns the full entry for a given model index.
◆ isFilterActive()
| bool SettingsSearchModel::isFilterActive |
( |
| ) |
const |
Whether a non-empty filter is currently active.
◆ rebuildFilter()
| void SettingsSearchModel::rebuildFilter |
( |
| ) |
|
|
private |
Recalculates the filtered index list and ranking.
◆ rowCount()
| int SettingsSearchModel::rowCount |
( |
const QModelIndex & | parent = QModelIndex() | ) |
const |
|
override |
◆ setFilterString()
| void SettingsSearchModel::setFilterString |
( |
const QString & | text | ) |
|
Sets the filter string and recalculates the results.
◆ setSourceEntries()
Replaces the source entries and rebuilds the filter.
◆ filterActive
| bool SettingsSearchModel::filterActive = false |
|
private |
Whether filtering is active.
◆ filteredIndices
| QList<int> SettingsSearchModel::filteredIndices |
|
private |
Indices into sourceEntries matching the filter.
◆ filterQuery
| QString SettingsSearchModel::filterQuery |
|
private |
Current filter query string.
◆ filterRegex
| QRegularExpression SettingsSearchModel::filterRegex |
|
private |
Compiled regex for the current filter.
◆ sourceEntries
Complete unfiltered entry list.
The documentation for this class was generated from the following files: