aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-07-18 17:12:14 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2018-07-19 09:05:30 +0000
commitb5d7be57ccb8ca60590ed30d04271e76acc84029 (patch)
tree2bea23bfdd86ba494f36aaa481cdbd14a0583d35 /tests/auto/quick/qquicktableview/tst_qquicktableview.cpp
parent379ba8640a9cf7e43e848eb07c11989f0f4f3ddd (diff)
QQuickTableView: set delegate parent early-on
Set the parent before bindings are evaluated. Change-Id: I370524fe32c66699bd73aafeac55c58667b4dff1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquicktableview/tst_qquicktableview.cpp')
-rw-r--r--tests/auto/quick/qquicktableview/tst_qquicktableview.cpp15
1 files changed, 15 insertions, 0 deletions
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<QSizeF>("spacing");