From b5d7be57ccb8ca60590ed30d04271e76acc84029 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Wed, 18 Jul 2018 17:12:14 +0200 Subject: QQuickTableView: set delegate parent early-on Set the parent before bindings are evaluated. Change-Id: I370524fe32c66699bd73aafeac55c58667b4dff1 Reviewed-by: Mitch Curtis --- tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/auto/quick/qquicktableview/tst_qquicktableview.cpp') diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 34d8dc8d55..9ba8d8a394 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -105,6 +105,7 @@ private slots: void checkInitialAttachedProperties_data(); void checkInitialAttachedProperties(); void checkSpacingValues(); + void checkDelegateParent(); void flick_data(); void flick(); void flickOvershoot_data(); @@ -732,6 +733,20 @@ void tst_QQuickTableView::checkSpacingValues() QCOMPARE(tableView->columnSpacing(), 12); } +void tst_QQuickTableView::checkDelegateParent() +{ + // Check that TableView sets the delegate parent before + // bindings are evaluated, so that the app can bind to it. + LOAD_TABLEVIEW("plaintableview.qml"); + + auto model = TestModelAsVariant(100, 100); + tableView->setModel(model); + + WAIT_UNTIL_POLISHED; + + QVERIFY(view->rootObject()->property("delegateParentSetBeforeCompleted").toBool()); +} + void tst_QQuickTableView::flick_data() { QTest::addColumn("spacing"); -- cgit v1.2.3