summaryrefslogtreecommitdiff
path: root/tests/auto/controls/data/tst_groupbox.qml
diff options
context:
space:
mode:
authorJens Bache-Wiig <jens.bache-wiig@digia.com>2013-05-22 15:16:10 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-23 14:36:02 +0200
commit57cb0961f811c90ddf5ed9298935d958e8afcd2a (patch)
tree432b48e624734bc8856676f699b47e55ec473763 /tests/auto/controls/data/tst_groupbox.qml
parent587c2c00678f8b3fe9e3249875630112cfb27de7 (diff)
downloadqtquickcontrols-57cb0961f811c90ddf5ed9298935d958e8afcd2a.tar.gz
Update GroupBox to support contentItem
- Removed contentWidth and contentHeight since it is not needed - Exposed contentItem so that it can be designable. - Respect the implicit width or height of the contentItem if it is the only item of the GroupBox. Otherwise childrenRect is used. - Modified the style so that the style takes care of only the padding size and not the entire size of the group box. - Fixed flat and checkable appearance for custom style Change-Id: I2c7ec4cb7d5e6f96863847e8d8d6d6f52428364e Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Diffstat (limited to 'tests/auto/controls/data/tst_groupbox.qml')
-rw-r--r--tests/auto/controls/data/tst_groupbox.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_groupbox.qml b/tests/auto/controls/data/tst_groupbox.qml
index 5599ca5f..6753868c 100644
--- a/tests/auto/controls/data/tst_groupbox.qml
+++ b/tests/auto/controls/data/tst_groupbox.qml
@@ -84,6 +84,34 @@ TestCase {
groupBox.destroy()
}
+ function test_contentItem() {
+ verify (groupBox.contentItem !== null)
+ verify (groupBox.contentItem.anchors !== undefined)
+ }
+
+ function test_dynamicSize() {
+
+ var groupbox = Qt.createQmlObject('import QtQuick.Controls 1.0; import QtQuick.Controls.Styles.Private 1.0 ; GroupBox {style:GroupBoxStyle{}}', container, '')
+ compare(groupbox.width, 16)
+ compare(groupbox.height, 16)
+
+ var content = Qt.createQmlObject('import QtQuick 2.1; Rectangle {implicitWidth:100 ; implicitHeight:30}', container, '')
+ content.parent = groupbox.contentItem
+ compare(groupbox.implicitWidth, 116)
+ compare(groupbox.implicitHeight, 46)
+ content.parent = null
+ content.destroy()
+
+ content = Qt.createQmlObject('import QtQuick 2.1; Rectangle {width:20 ; height:20}', container, '')
+ content.parent = groupbox.contentItem
+ compare(groupbox.implicitWidth, 36)
+ compare(groupbox.implicitHeight, 36)
+ content.parent = null
+ content.destroy()
+
+ groupbox.destroy()
+ }
+
function test_checkable() {
compare(groupBox.checkable, false)
compare(groupBox.child1.enabled, true)