mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-08 00:06:51 -05:00
also move triggering of results to core
This commit is contained in:
parent
dd14e58172
commit
31cd1644c3
@ -53,6 +53,11 @@ Returns true if some text to be search is pending in the queue
|
||||
bool isRunning() const;
|
||||
%Docstring
|
||||
Returns true if the a search is currently running
|
||||
%End
|
||||
|
||||
void triggerResult( const QModelIndex &index );
|
||||
%Docstring
|
||||
Triggers the result at given index
|
||||
%End
|
||||
|
||||
signals:
|
||||
|
||||
@ -37,6 +37,13 @@ bool QgsLocatorModelBridge::isRunning() const
|
||||
return mIsRunning;
|
||||
}
|
||||
|
||||
void QgsLocatorModelBridge::triggerResult( const QModelIndex &index )
|
||||
{
|
||||
mLocator->clearPreviousResults();
|
||||
QgsLocatorResult result = mProxyModel->data( index, QgsLocatorModel::ResultDataRole ).value< QgsLocatorResult >();
|
||||
result.filter->triggerResult( result );
|
||||
}
|
||||
|
||||
void QgsLocatorModelBridge::setIsRunning( bool isRunning )
|
||||
{
|
||||
if ( mIsRunning == isRunning )
|
||||
|
||||
@ -60,6 +60,9 @@ class CORE_EXPORT QgsLocatorModelBridge : public QObject
|
||||
//! Returns true if the a search is currently running
|
||||
bool isRunning() const;
|
||||
|
||||
//! Triggers the result at given index
|
||||
void triggerResult( const QModelIndex &index );
|
||||
|
||||
signals:
|
||||
//! Emitted when a result is added
|
||||
void resultAdded();
|
||||
|
||||
@ -312,11 +312,9 @@ void QgsLocatorWidget::acceptCurrentEntry()
|
||||
if ( !index.isValid() )
|
||||
return;
|
||||
|
||||
QgsLocatorResult result = mModelBridge->proxyModel()->data( index, QgsLocatorModel::ResultDataRole ).value< QgsLocatorResult >();
|
||||
mResultsContainer->hide();
|
||||
mLineEdit->clearFocus();
|
||||
mModelBridge->locator()->clearPreviousResults();
|
||||
result.filter->triggerResult( result );
|
||||
mModelBridge->triggerResult( index );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user