38
38
#include " qgsunittypes.h"
39
39
#include " qgsstatusbar.h"
40
40
#include " qgsactionscoperegistry.h"
41
+ #include " qgsproxyprogresstask.h"
41
42
42
43
#include " qgssettings.h"
43
44
#include < QMouseEvent>
@@ -111,7 +112,14 @@ void QgsMapToolIdentifyAction::showAttributeTable( QgsMapLayer *layer, const QLi
111
112
void QgsMapToolIdentifyAction::identifyFromGeometry ()
112
113
{
113
114
resultsDialog ()->clear ();
114
- connect ( this , &QgsMapToolIdentifyAction::identifyProgress, QgisApp::instance (), &QgisApp::showProgress );
115
+
116
+ QgsProxyProgressTask *task = new QgsProxyProgressTask ( tr ( " Identifying features" ) );
117
+ QgsApplication::taskManager ()->addTask ( task );
118
+
119
+ connect ( this , &QgsMapToolIdentifyAction::identifyProgress, task, [ = ]( int i, int n )
120
+ {
121
+ task->setProxyProgress ( static_cast <double >( i ) * 100.0 / n );
122
+ } );
115
123
connect ( this , &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance (), &QgisApp::showStatusMessage );
116
124
117
125
QgsGeometry geometry = mSelectionHandler ->selectedGeometry ();
@@ -131,7 +139,7 @@ void QgsMapToolIdentifyAction::identifyFromGeometry()
131
139
132
140
QList<IdentifyResult> results = QgsMapToolIdentify::identify ( geometry, mode, AllLayers );
133
141
134
- disconnect ( this , &QgsMapToolIdentifyAction::identifyProgress, QgisApp::instance (), &QgisApp::showProgress );
142
+ task-> finalize ( true );
135
143
disconnect ( this , &QgsMapToolIdentifyAction::identifyMessage, QgisApp::instance (), &QgisApp::showStatusMessage );
136
144
137
145
if ( results.isEmpty () )
0 commit comments