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