diff options
Diffstat (limited to 'tests/auto/quick/qquicktableview')
-rw-r--r-- | tests/auto/quick/qquicktableview/tst_qquicktableview.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp index 94d3a356fe..b2f4e412f1 100644 --- a/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp +++ b/tests/auto/quick/qquicktableview/tst_qquicktableview.cpp @@ -96,6 +96,7 @@ private slots: void checkRowHeightProviderInvalidReturnValues(); void checkRowHeightProviderNotCallable(); void checkContentWidthAndHeight(); + void checkExplicitContentWidthAndHeight(); void noDelegate(); void countDelegateItems_data(); void countDelegateItems(); @@ -481,6 +482,24 @@ void tst_QQuickTableView::checkContentWidthAndHeight() QCOMPARE(tableView->contentHeight(), expectedFullSize); } +void tst_QQuickTableView::checkExplicitContentWidthAndHeight() +{ + // Check that you can set a custom contentWidth/Height, and that + // TableView doesn't override it while loading more rows and columns. + LOAD_TABLEVIEW("contentwidthheight.qml"); + + tableView->setContentWidth(1000); + tableView->setContentHeight(1000); + QCOMPARE(tableView->contentWidth(), 1000); + QCOMPARE(tableView->contentHeight(), 1000); + + // Flick somewhere. It should not affect the contentWidth/Height + tableView->setContentX(500); + tableView->setContentY(500); + QCOMPARE(tableView->contentWidth(), 1000); + QCOMPARE(tableView->contentHeight(), 1000); +} + void tst_QQuickTableView::noDelegate() { // Check that you can skip setting a delegate without |