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

Methods

hasQueueRequested

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

invalidateResults

This will invalidate current search results

isRunning

Returns True if the a search is currently running

locator

Returns the locator

performSearch

Perform a search

proxyModel

Returns the proxy model

selectionChanged

This will call filters implementation of selection/deselection of results

setTransformContext

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

transformContext

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

triggerResult

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

updateCanvasCrs

Update the canvas CRS used to create search context

updateCanvasExtent

Update the canvas extent used to create search context

Signals

isRunningChanged

Emitted when the running status changes

resultAdded

Emitted when a result is added

resultsCleared

Emitted when the results are cleared

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]

Emitted when the running status changes

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]

Emitted when a result is added

signal resultsCleared[source]

Emitted when the results are cleared

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)