18 #ifndef QGSLOCATORMODEL_H
19 #define QGSLOCATORMODEL_H
21 #include "qgis_core.h"
23 #include <QAbstractListModel>
26 #include <QSortFilterProxyModel>
48 static const int NoGroup = 9999;
53 ResultDataRole = Qt::UserRole + 1,
81 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
82 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
83 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
84 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
85 QHash<int, QByteArray> roleNames()
const override;
107 QString groupTitle = QString();
108 int groupSorting = 0;
111 QList<Entry> mResults;
112 QSet<QString> mFoundResultsFromFilterNames;
113 QMap<QgsLocatorFilter *, QStringList> mFoundResultsFilterGroups;
114 bool mDeferredClear =
false;
115 QTimer mDeferredClearTimer;
163 void search(
const QString &
string );
174 void searchFinished();
180 QString mNextRequestedString;
181 bool mHasQueuedRequest =
false;
201 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
A QgsLocatorModel which has is associated directly with a QgsLocator, and is automatically populated ...
Encapsulates the properties relating to the context of a locator search.
Abstract base class for filters which collect locator results.
An abstract list model for displaying the results of locator searches.
@ ResultScoreRole
Result match score, used by QgsLocatorProxyModel for sorting roles.
@ ResultFilterNameRole
Associated filter name which created the result.
@ ResultActionsRole
The actions to be shown for the given result in a context menu.
@ ResultFilterPriorityRole
Result priority, used by QgsLocatorProxyModel for sorting roles.
@ ResultFilterGroupSortingRole
Group results within the same filter results.
@ ResultTypeRole
Result type.
A sort proxy model for QgsLocatorModel, which automatically sorts results by precedence.
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
Handles the management of QgsLocatorFilter objects and async collection of search results from them.