diff options
Diffstat (limited to 'tests/auto/quickcontrols2/controls/data/tst_combobox.qml')
-rw-r--r-- | tests/auto/quickcontrols2/controls/data/tst_combobox.qml | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/quickcontrols2/controls/data/tst_combobox.qml b/tests/auto/quickcontrols2/controls/data/tst_combobox.qml index 7da491d499..e9575369e1 100644 --- a/tests/auto/quickcontrols2/controls/data/tst_combobox.qml +++ b/tests/auto/quickcontrols2/controls/data/tst_combobox.qml @@ -2336,4 +2336,23 @@ TestCase { compare(textField.selectedText, "") compare(control.currentIndex, 1) } + + Component { + id: listOfGadgets + QtObject { + property var rects: [Qt.rect(1, 2, 3, 4), Qt.rect(5, 6, 7, 8)] + } + } + + function test_listOfGadgetsWithRole() { + let model = listOfGadgets.createObject(testCase); + let control = createTemporaryObject( + comboBox, testCase, {model: model.rects, textRole: "width"}); + verify(control); + compare(control.currentIndex, 0); + compare(control.displayText, "3"); + + control.currentIndex = 1; + compare(control.displayText, "7"); + } } |