aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp')
-rw-r--r--tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
index 8e6d147028..1a772b8a1e 100644
--- a/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
+++ b/tests/auto/qml/qqmldelegatemodel/tst_qqmldelegatemodel.cpp
@@ -29,6 +29,8 @@
#include <QtTest/qtest.h>
#include <QtQml/qqmlcomponent.h>
#include <QtQmlModels/private/qqmldelegatemodel_p.h>
+#include <QtQuick/qquickview.h>
+#include <QtQuick/qquickitem.h>
#include "../../shared/util.h"
@@ -43,6 +45,7 @@ private slots:
void valueWithoutCallingObjectFirst_data();
void valueWithoutCallingObjectFirst();
void qtbug_86017();
+ void filterOnGroup_removeWhenCompleted();
};
class AbstractItemModel : public QAbstractItemModel
@@ -150,6 +153,18 @@ void tst_QQmlDelegateModel::qtbug_86017()
QCOMPARE(model->filterGroup(), "selected");
}
+void tst_QQmlDelegateModel::filterOnGroup_removeWhenCompleted()
+{
+ QQuickView view(testFileUrl("removeFromGroup.qml"));
+ QCOMPARE(view.status(), QQuickView::Ready);
+ view.show();
+ QQuickItem *root = view.rootObject();
+ QVERIFY(root);
+ QQmlDelegateModel *model = root->findChild<QQmlDelegateModel*>();
+ QVERIFY(model);
+ QTest::qWaitFor([=]{ return model->count() == 2; } );
+}
+
QTEST_MAIN(tst_QQmlDelegateModel)
#include "tst_qqmldelegatemodel.moc"