diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-11 22:20:53 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-04-16 07:38:19 +0000 |
commit | 8f2e79776594b4466cc7766a057b5121dc0fe6ff (patch) | |
tree | 8705940ad0c36453eefa95a296eab572497574be /tests/auto/controls/data/tst_buttongroup.qml | |
parent | 4b9b1a6e8df12e4a0b726f45b28afe1705a234cd (diff) |
ButtonGroup::buttons: avoid losing the checked button on re-assignment
Task-number: QTBUG-52358
Change-Id: I405947215cdbc6e99fe02dbc85e31c40656fc11a
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'tests/auto/controls/data/tst_buttongroup.qml')
-rw-r--r-- | tests/auto/controls/data/tst_buttongroup.qml | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/auto/controls/data/tst_buttongroup.qml b/tests/auto/controls/data/tst_buttongroup.qml index b640a868..60253e93 100644 --- a/tests/auto/controls/data/tst_buttongroup.qml +++ b/tests/auto/controls/data/tst_buttongroup.qml @@ -212,7 +212,7 @@ TestCase { group.buttons = [] compare(group.buttons.length, 0) - compare(group.checkedButton, null) + tryCompare(group, "checkedButton", null) compare(buttonsSpy.count, 5) group.destroy() @@ -321,4 +321,31 @@ TestCase { group.destroy() } + + Component { + id: repeater + Column { + id: column + property ButtonGroup group: ButtonGroup { buttons: column.children } + property alias repeater: r + Repeater { + id: r + model: 3 + delegate: RadioDelegate { + checked: index == 0 + objectName: index + } + } + } + } + + function test_repeater() { + var container = repeater.createObject(testCase) + verify(container) + + verify(container.group.checkedButton) + compare(container.group.checkedButton.objectName, "0") + + container.destroy() + } } |