Skip to content
Permalink
Browse files

Merge pull request #34309 from elpaso/bugfixgh-gh34259-filter-express…

…ion-with-errors

Fix test message from query builder on errors
  • Loading branch information
elpaso committed Feb 5, 2020
2 parents e0615d4 + 5d8c4f8 commit f8d863c3b6ba1ec95da8a68166f173934d9fac97
Showing with 14 additions and 3 deletions.
  1. +14 −3 src/gui/qgsquerybuilder.cpp
@@ -218,9 +218,20 @@ void QgsQueryBuilder::test()
{
mUseUnfilteredLayer->setDisabled( mLayer->subsetString().isEmpty() );

QMessageBox::information( this,
tr( "Query Result" ),
tr( "The where clause returned %n row(s).", "returned test rows", mLayer->featureCount() ) );
const long featureCount { mLayer->featureCount() };
// Check for errors
if ( featureCount < 0 )
{
QMessageBox::warning( this,
tr( "Query Result" ),
tr( "An error occurred when executing the query, please check the expression syntax." ) );
}
else
{
QMessageBox::information( this,
tr( "Query Result" ),
tr( "The where clause returned %n row(s).", "returned test rows", featureCount ) );
}
}
else if ( mLayer->dataProvider()->hasErrors() )
{

0 comments on commit f8d863c

Please sign in to comment.
You can’t perform that action at this time.