aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-05-31 11:02:40 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-05-31 12:14:45 +0000
commit830ab8aa4fa805c011eb082dfd2075ab4f03f919 (patch)
treed28e9588b8551ebe9bf17480a2cde830db3672bf /tests/auto/controls
parent1f26b91740807f6a8c9d480bcb0d63ea2e0c10d6 (diff)
Page: fix initial layouting of dynamically created instances
Task-number: QTBUG-61109 Change-Id: I43d28a80ec1a46e836fa8a0f76ee65b0c1a24228 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls')
-rw-r--r--tests/auto/controls/data/tst_page.qml37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_page.qml b/tests/auto/controls/data/tst_page.qml
index 60eb02de..2eb11165 100644
--- a/tests/auto/controls/data/tst_page.qml
+++ b/tests/auto/controls/data/tst_page.qml
@@ -100,6 +100,18 @@ TestCase {
}
Component {
+ id: headerFooterPage
+ Page {
+ header: ToolBar { }
+ footer: ToolBar { }
+ contentItem: Item {
+ implicitWidth: 100
+ implicitHeight: 30
+ }
+ }
+ }
+
+ Component {
id: toolBar
ToolBar { }
}
@@ -262,4 +274,29 @@ TestCase {
- (data.header ? control.header.height + control.spacing : 0)
- (data.footer ? control.footer.height + control.spacing : 0))
}
+
+ function test_headerFooter() {
+ var control = createTemporaryObject(headerFooterPage, testCase, {width: 100, height: 100})
+ verify(control)
+
+ compare(control.width, 100)
+ compare(control.height, 100)
+
+ verify(control.header)
+ compare(control.header.x, 0)
+ compare(control.header.y, 0)
+ compare(control.header.width, control.width)
+ verify(control.header.height > 0)
+
+ verify(control.footer)
+ compare(control.footer.x, 0)
+ compare(control.footer.y, control.height - control.footer.height)
+ compare(control.footer.width, control.width)
+ verify(control.footer.height > 0)
+
+ compare(control.contentItem.x, 0)
+ compare(control.contentItem.y, control.header.height)
+ compare(control.contentItem.width, control.width)
+ compare(control.contentItem.height, control.height - control.header.height - control.footer.height)
+ }
}