Skip to content

Commit

Permalink
wait for filtered features before continue test
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed May 5, 2020
1 parent 0290b8c commit c820d0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/src/app/testqgsattributetable.cpp
Expand Up @@ -428,6 +428,9 @@ void TestQgsAttributeTable::testFilteredFeatures()

std::unique_ptr< QgsAttributeTableDialog > dlg( new QgsAttributeTableDialog( tempLayer.get(), QgsAttributeTableFilterModel::ShowAll ) );

QEventLoop loop;
connect( qobject_cast<QgsAttributeTableFilterModel *>( dlg->mMainView->mFilterModel ), &QgsAttributeTableFilterModel::featuresFiltered, &loop, &QEventLoop::quit );

// show all (three features)
dlg->mFeatureFilterWidget->filterShowAll();
QCOMPARE( dlg->mMainView->featureCount(), 3 );
Expand Down Expand Up @@ -463,7 +466,7 @@ void TestQgsAttributeTable::testFilteredFeatures()
f6.setAttribute( 1, 12 );
QVERIFY( tempLayer->addFeatures( QgsFeatureList() << f5 << f6 ) );
tempLayer->commitChanges();

loop.exec();
//no filter change -> now two of six features
QCOMPARE( dlg->mMainView->featureCount(), 6 );
QCOMPARE( dlg->mMainView->filteredFeatureCount(), 2 );
Expand Down

0 comments on commit c820d0f

Please sign in to comment.