Skip to content
Permalink
Browse files

wait for filtered features before continue test

  • Loading branch information
signedav committed May 5, 2020
1 parent 0290b8c commit c820d0f494dc3a66b8323490907f77637ce748e1
Showing with 4 additions and 1 deletion.
  1. +4 −1 tests/src/app/testqgsattributetable.cpp
@@ -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 );
@@ -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 );

0 comments on commit c820d0f

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