18#ifndef QGSLOCATORWIDGET_H
19#define QGSLOCATORWIDGET_H
34using namespace Qt::StringLiterals;
37class QgsLocatorResultsView;
40class QgsLocatorLineEdit;
96 void search(
const QString &
string );
112 bool eventFilter( QObject *obj, QEvent *event )
override;
115 void performSearch();
117 void triggerSearchAndShowList();
118 void configMenuAboutToShow();
119 void scheduleDelayedPopup();
121 void showContextMenu(
const QPoint &point );
122 void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
126 QgsLocatorLineEdit *mLineEdit =
nullptr;
128 QgsLocatorResultsView *mResultsView =
nullptr;
130 QList<QMetaObject::Connection> mCanvasConnections;
131 QMenu *mMenu =
nullptr;
135 bool mHasSelectedResult =
false;
137 void acceptCurrentEntry();
149 QgsLocatorFilterFilter(
QgsLocatorWidget *widget, QObject *parent =
nullptr );
154 QString name()
const override {
return u
"filters"_s; }
155 QString
displayName()
const override {
return QString(); }
157 void fetchResults(
const QString &
string,
const QgsLocatorContext &context, QgsFeedback *feedback )
override;
158 void triggerResult(
const QgsLocatorResult &result )
override;
161 QgsLocatorWidget *mLocator =
nullptr;
169class GUI_EXPORT QgsLocatorResultsView :
public QTreeView
177 QgsLocatorResultsView( QWidget *parent =
nullptr );
182 void recalculateSize();
187 void selectNextResult();
192 void selectPreviousResult();
206 explicit QgsLocatorLineEdit( QgsLocatorWidget *locator, QWidget *parent =
nullptr );
209 bool performCompletion();
212 void paintEvent( QPaintEvent *event )
override;
215 QgsLocatorWidget *mLocatorWidget =
nullptr;
216 QString mCompletionText =
nullptr;
QLineEdit subclass with built in support for clearing the widget's value and handling custom null val...
Abstract base class for filters which collect locator results.
Priority
Filter priority. Controls the order of results in the locator.
virtual QString displayName() const =0
Returns a translated, user-friendly name for the filter.
virtual Priority priority() const
Returns the priority for the filter, which controls how results are ordered in the locator.
virtual void triggerResult(const QgsLocatorResult &result)=0
Triggers a filter result from this filter.
virtual QgsLocatorFilter * clone() const =0
Creates a clone of the filter.
virtual void fetchResults(const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback)=0
Retrieves the filter results for a specified search string.
Provides the core functionality to be used in a locator widget.
Handles the management of QgsLocatorFilter objects and async collection of search results from them.
Map canvas is a class for displaying all GIS data types on a canvas.
An integer settings entry.
A tree node for the settings tree to help organizing and introspecting the tree.
static QgsSettingsTreeNode * sTreeGui