QgsLocatorWidget class

A special locator widget which allows searching for matching results from a QgsLocator and presenting them to users for selection.

Constructors, destructors, conversion operators

QgsLocatorWidget(QWidget*parent SIP_TRANSFERTHIS = nullptr)
Constructor for QgsLocatorWidget.

Public functions

auto locator() -> QgsLocator*
Returns a pointer to the locator utilized by this widget.
void setMapCanvas(QgsMapCanvas* canvas)
Sets a map canvas to associate with the widget.

Signals

void configTriggered()
Emitted when the configure option is triggered in the widget.

Public slots

void invalidateResults()
Invalidates the current search results, e.g.
void search(const QString& string)
Triggers the locator widget to focus, open and start searching for a specified string.

Function documentation

void QgsLocatorWidget::setMapCanvas(QgsMapCanvas* canvas)

Sets a map canvas to associate with the widget.

This allows the widget to customize the searches performed by its locator(), such as prioritizing results which are near the current canvas extent.

void QgsLocatorWidget::invalidateResults() public slot

Invalidates the current search results, e.g.

as a result of changes to the locator filter settings.