Class: QgsLocatorModelBridge

Provides the core functionality to be used in a locator widget.

Added in version 3.6.

Class Hierarchy

Inheritance diagram of qgis.core.QgsLocatorModelBridge

Base classes

QObject

class qgis.core.QgsLocatorModelBridge[source]

Bases: QObject

__init__(parent: QObject | None = None)

Constructor of QgsLocatorModelBridge

Parameters:

parent (Optional[QObject] = None)

hasQueueRequested(self) bool[source]

Returns True if some text to be search is pending in the queue

Return type:

bool

invalidateResults(self)[source]

This will invalidate current search results

isRunning(self) bool[source]

Returns True if the a search is currently running

Return type:

bool

signal isRunningChanged[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

locator(self) QgsLocator | None[source]

Returns the locator

Return type:

Optional[QgsLocator]

performSearch(self, text: str | None)[source]

Perform a search

Parameters:

text (Optional[str])

proxyModel(self) QgsLocatorProxyModel | None[source]

Returns the proxy model

Return type:

Optional[QgsLocatorProxyModel]

signal resultAdded[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

signal resultsCleared[source]

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

selectionChanged(self, selected: QItemSelection, deselected: QItemSelection)[source]

This will call filters implementation of selection/deselection of results

Added in version 3.40.

Parameters:
  • selected (QItemSelection)

  • deselected (QItemSelection)

setTransformContext(self, context: QgsCoordinateTransformContext)[source]

Sets the coordinate transform context, which should be used whenever the locator constructs a coordinate transform.

Added in version 3.18.

Parameters:

context (QgsCoordinateTransformContext)

transformContext(self) QgsCoordinateTransformContext[source]

Returns the coordinate transform context, which should be used whenever the locator constructs a coordinate transform.

Added in version 3.18.

Return type:

QgsCoordinateTransformContext

triggerResult(self, index: QModelIndex, actionId: int = -1)[source]

Triggers the result at given index and with optional actionId if an additional action was triggered

Parameters:
  • index (QModelIndex)

  • actionId (int = -1)

updateCanvasCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Update the canvas CRS used to create search context

Parameters:

crs (QgsCoordinateReferenceSystem)

updateCanvasExtent(self, extent: QgsRectangle)[source]

Update the canvas extent used to create search context

Parameters:

extent (QgsRectangle)