aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-25 13:05:48 +0100
committerJ-P Nurmi <jpnurmi@theqtcompany.com>2016-01-25 12:13:31 +0000
commit06d4931ede0a1b4422a52014b3bed7a4036d6bcc (patch)
tree05ea5d744898928460f6781754de8f0b5c07ce63 /tests/auto
parentd665c0faf4ac52a8aeed48ee8497b5d61becedc5 (diff)
Containers: use the implicit size of the contentItem
The result of: Frame { ColumnLayout { RadioButton { text: "First" } RadioButton { text: "Second" } RadioButton { text: "Third" } } } is now identical to: Frame { contentItem: ColumnLayout { RadioButton { text: "First" } RadioButton { text: "Second" } RadioButton { text: "Third" } } } Change-Id: I823b2259dabb66db0dddef41ea396f7ac1000a82 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/controls/data/tst_frame.qml26
-rw-r--r--tests/auto/controls/data/tst_groupbox.qml22
-rw-r--r--tests/auto/controls/data/tst_pane.qml26
-rw-r--r--tests/auto/controls/data/tst_toolbar.qml34
4 files changed, 98 insertions, 10 deletions
diff --git a/tests/auto/controls/data/tst_frame.qml b/tests/auto/controls/data/tst_frame.qml
index feb6cf11..d50a0dfc 100644
--- a/tests/auto/controls/data/tst_frame.qml
+++ b/tests/auto/controls/data/tst_frame.qml
@@ -57,7 +57,7 @@ TestCase {
Component {
id: oneChildFrame
- GroupBox {
+ Frame {
Item {
implicitWidth: 100
implicitHeight: 30
@@ -67,7 +67,7 @@ TestCase {
Component {
id: twoChildrenFrame
- GroupBox {
+ Frame {
Item {
implicitWidth: 100
implicitHeight: 30
@@ -79,6 +79,16 @@ TestCase {
}
}
+ Component {
+ id: contentFrame
+ Frame {
+ contentItem: Item {
+ implicitWidth: 100
+ implicitHeight: 30
+ }
+ }
+ }
+
function test_empty() {
var control = frame.createObject(testCase)
verify(control)
@@ -113,4 +123,16 @@ TestCase {
control.destroy()
}
+
+ function test_contentItem() {
+ var control = contentFrame.createObject(testCase)
+ verify(control)
+
+ compare(control.contentWidth, 100)
+ compare(control.contentHeight, 30)
+ verify(control.implicitWidth > 100)
+ verify(control.implicitHeight > 30)
+
+ control.destroy()
+ }
}
diff --git a/tests/auto/controls/data/tst_groupbox.qml b/tests/auto/controls/data/tst_groupbox.qml
index 55568923..0f0e33fb 100644
--- a/tests/auto/controls/data/tst_groupbox.qml
+++ b/tests/auto/controls/data/tst_groupbox.qml
@@ -79,6 +79,16 @@ TestCase {
}
}
+ Component {
+ id: contentBox
+ GroupBox {
+ contentItem: Item {
+ implicitWidth: 100
+ implicitHeight: 30
+ }
+ }
+ }
+
function test_empty() {
var control = groupBox.createObject(testCase)
verify(control)
@@ -113,4 +123,16 @@ TestCase {
control.destroy()
}
+
+ function test_contentItem() {
+ var control = contentBox.createObject(testCase)
+ verify(control)
+
+ compare(control.contentWidth, 100)
+ compare(control.contentHeight, 30)
+ verify(control.implicitWidth > 100)
+ verify(control.implicitHeight > 30)
+
+ control.destroy()
+ }
}
diff --git a/tests/auto/controls/data/tst_pane.qml b/tests/auto/controls/data/tst_pane.qml
index 18fd1cf0..1fdec049 100644
--- a/tests/auto/controls/data/tst_pane.qml
+++ b/tests/auto/controls/data/tst_pane.qml
@@ -57,7 +57,7 @@ TestCase {
Component {
id: oneChildPane
- GroupBox {
+ Pane {
Item {
implicitWidth: 100
implicitHeight: 30
@@ -67,7 +67,7 @@ TestCase {
Component {
id: twoChildrenPane
- GroupBox {
+ Pane {
Item {
implicitWidth: 100
implicitHeight: 30
@@ -80,6 +80,16 @@ TestCase {
}
Component {
+ id: contentPane
+ Pane {
+ contentItem: Item {
+ implicitWidth: 100
+ implicitHeight: 30
+ }
+ }
+ }
+
+ Component {
id: pressPane
MouseArea {
width: 200
@@ -127,6 +137,18 @@ TestCase {
control.destroy()
}
+ function test_contentItem() {
+ var control = contentPane.createObject(testCase)
+ verify(control)
+
+ compare(control.contentWidth, 100)
+ compare(control.contentHeight, 30)
+ verify(control.implicitWidth > 100)
+ verify(control.implicitHeight > 30)
+
+ control.destroy()
+ }
+
function test_press() {
var control = pressPane.createObject(testCase)
verify(control)
diff --git a/tests/auto/controls/data/tst_toolbar.qml b/tests/auto/controls/data/tst_toolbar.qml
index ac116a86..128aa403 100644
--- a/tests/auto/controls/data/tst_toolbar.qml
+++ b/tests/auto/controls/data/tst_toolbar.qml
@@ -57,7 +57,7 @@ TestCase {
Component {
id: oneChildBar
- GroupBox {
+ ToolBar {
Item {
implicitWidth: 100
implicitHeight: 30
@@ -67,7 +67,7 @@ TestCase {
Component {
id: twoChildrenBar
- GroupBox {
+ ToolBar {
Item {
implicitWidth: 100
implicitHeight: 30
@@ -79,6 +79,16 @@ TestCase {
}
}
+ Component {
+ id: contentBar
+ ToolBar {
+ contentItem: Item {
+ implicitWidth: 100
+ implicitHeight: 30
+ }
+ }
+ }
+
function test_empty() {
var control = toolBar.createObject(testCase)
verify(control)
@@ -96,8 +106,8 @@ TestCase {
compare(control.contentWidth, 100)
compare(control.contentHeight, 30)
- verify(control.implicitWidth > 100)
- verify(control.implicitHeight > 30)
+ verify(control.implicitWidth >= 100)
+ verify(control.implicitHeight >= 30)
control.destroy()
}
@@ -108,8 +118,20 @@ TestCase {
compare(control.contentWidth, 0)
compare(control.contentHeight, 0)
- verify(control.implicitWidth > 0)
- verify(control.implicitHeight > 0)
+ verify(control.implicitWidth >= 0)
+ verify(control.implicitHeight >= 0)
+
+ control.destroy()
+ }
+
+ function test_contentItem() {
+ var control = contentBar.createObject(testCase)
+ verify(control)
+
+ compare(control.contentWidth, 100)
+ compare(control.contentHeight, 30)
+ verify(control.implicitWidth >= 100)
+ verify(control.implicitHeight >= 30)
control.destroy()
}