Class: QgsLocatorWidget¶
A special locator widget which allows searching for matching results
from a QgsLocator
and presenting them to users for
selection.
See also
Class Hierarchy¶
Base classes¶
Methods
Invalidates the current search results, e.g. as a result of changes to the locator filter settings. |
|
Returns a pointer to the locator utilized by this widget. |
|
Triggers the locator widget to focus, open and start searching for a specified string. |
|
Sets a map canvas to associate with the widget. |
|
Set placeholder text for the line edit. |
|
Sets the result container anchorPoint and anchorWidgetPoint position. |
Signals
Emitted when the configure option is triggered in the widget. |
- class qgis.gui.QgsLocatorWidget[source]¶
Bases:
QWidget
- __init__(parent: QWidget | None = None)
Constructor for QgsLocatorWidget.
- Parameters:
parent (Optional[QWidget] = None)
- invalidateResults(self)[source]¶
Invalidates the current search results, e.g. as a result of changes to the locator filter settings.
- locator(self) QgsLocator | None [source]¶
Returns a pointer to the locator utilized by this widget.
- Return type:
Optional[QgsLocator]
- search(self, string: str | None)[source]¶
Triggers the locator widget to focus, open and start searching for a specified
string
.- Parameters:
string (Optional[str])
- setMapCanvas(self, canvas: QgsMapCanvas | None)[source]¶
Sets a map
canvas
to associate with the widget. This allows the widget to customize the searches performed by itslocator()
, such as prioritizing results which are near the current canvas extent.- Parameters:
canvas (Optional[QgsMapCanvas])
- setPlaceholderText(self, text: str | None)[source]¶
Set placeholder
text
for the line edit.Added in version 3.36.
- Parameters:
text (Optional[str])
- setResultContainerAnchors(self, anchorPoint: QgsFloatingWidget.AnchorPoint, anchorWidgetPoint: QgsFloatingWidget.AnchorPoint)[source]¶
Sets the result container
anchorPoint
andanchorWidgetPoint
position.Added in version 3.36.
- Parameters:
anchorPoint (QgsFloatingWidget.AnchorPoint)
anchorWidgetPoint (QgsFloatingWidget.AnchorPoint)