QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
29 mProxyModel->setSourceModel( mLocatorModel );
53 void QgsLocatorModelBridge::setIsRunning(
bool isRunning )
65 mLocatorModel->
clear();
70 mCanvasExtent = extent;
85 void QgsLocatorModelBridge::searchFinished()
87 if ( mHasQueuedRequest )
90 QString nextSearch = mNextRequestedString;
91 mNextRequestedString.clear();
92 mHasQueuedRequest =
false;
98 setIsRunning(
false );
104 setIsRunning(
true );
112 mNextRequestedString = text;
113 mHasQueuedRequest =
true;
136 return mHasQueuedRequest;
Handles the management of QgsLocatorFilter objects and async collection of search results from them.
QgsLocatorFilter * filter
Filter from which the result was obtained.
const QgsCoordinateReferenceSystem & crs
void deferredClear()
Resets the model and clears all existing results after a short delay, or whenever the next result is ...
void clear()
Resets the model and clears all existing results.
@ ResultDataRole
QgsLocatorResult data.
A rectangle specified with double values.
void clearPreviousResults()
Will call clearPreviousResults on all filters.
Encapsulates properties of an individual matching result found by a QgsLocatorFilter.
QgsRectangle targetExtent
Map extent to target in results.
void resultAdded()
Emitted when a result is added.
Q_INVOKABLE QgsLocatorProxyModel * proxyModel() const
Returns the proxy model.
void triggerResult(const QModelIndex &index, const int actionId=-1)
Triggers the result at given index and with optional actionId if an additional action was triggered.
An abstract list model for displaying the results of locator searches.
Encapsulates the properties relating to the context of a locator search.
QgsCoordinateReferenceSystem targetExtentCrs
Coordinate reference system for the map extent variable.
void invalidateResults()
This will invalidate current search results.
void addResult(const QgsLocatorResult &result)
Adds a new result to the model.
void fetchResults(const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback=nullptr)
Triggers the background fetching of filter results for a specified search string.
This class represents a coordinate reference system (CRS).
void updateCanvasCrs(const QgsCoordinateReferenceSystem &crs)
Update the canvas CRS used to create search context.
A sort proxy model for QgsLocatorModel, which automatically sorts results by precedence.
void updateCanvasExtent(const QgsRectangle &extent)
Update the canvas extent used to create search context.
bool hasQueueRequested() const
Returns true if some text to be search is pending in the queue.
QgsLocatorModelBridge(QObject *parent=nullptr)
Constructor of QgsLocatorModelBridge.
Q_INVOKABLE void performSearch(const QString &text)
Perform a search.
void resultsCleared()
Emitted when the results are cleared.
bool isRunning() const
Returns true if a query is currently being executed by the locator.
void cancelWithoutBlocking()
Triggers cancellation of any current running query without blocking.
QgsLocator * locator() const
Returns the locator.
virtual void triggerResult(const QgsLocatorResult &result)=0
Triggers a filter result from this filter.
void finished()
Emitted when locator has finished a query, either as a result of successful completion or early cance...
void foundResult(const QgsLocatorResult &result)
Emitted whenever a filter encounters a matching result after the fetchResults() method is called.
void isRunningChanged()
Emitted when the running status changes.
virtual void triggerResultFromAction(const QgsLocatorResult &result, const int actionId)
Triggers a filter result from this filter for an entry in the context menu.