Skip to content

Commit f5aca96

Browse files
committed
[spatialquery] shows the warning in message bar when no layer is loaded in canvas
1 parent f12e1e0 commit f5aca96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/plugins/spatialquery/qgsspatialqueryplugin.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "qgisinterface.h"
2525
#include "qgsapplication.h"
2626
#include "qgsmaplayerregistry.h"
27+
#include "qgsmessagebar.h"
2728

2829
//
2930
// Required plugin includes
@@ -111,7 +112,7 @@ void QgsSpatialQueryPlugin::run()
111112
QString msg;
112113
if ( ! QgsSpatialQueryDialog::hasPossibleQuery( msg ) )
113114
{
114-
QMessageBox::warning( mIface->mainWindow(), tr( "Query not executed" ), msg, QMessageBox::Ok );
115+
mIface->messageBar()->pushMessage( tr( "Query not executed" ), msg, QgsMessageBar::INFO, mIface->messageTimeout() );
115116
return;
116117
}
117118
mDialog = new QgsSpatialQueryDialog( mIface->mainWindow(), mIface );

0 commit comments

Comments
 (0)