diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 802d23e4..256e213e 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -118,13 +118,15 @@ TestCase { } function test_arraymodelwithtextrole() { - // FIXME The use-case before this change should work. - var comboBox = Qt.createQmlObject('import QtQuick.Controls 1.1 ; \ - ComboBox { \ - model: [ { "text": "Banana", "color": "Yellow"}, \ - { "text": "Apple", "color": "Green"}, \ - { "text": "Coconut", "color": "Brown"} ]; \ - textRole: "text" }', testCase, ''); + var arrayModel = [ + {text: 'Banana', color: 'Yellow'}, + {text: 'Apple', color: 'Green'}, + {text: 'Coconut', color: 'Brown'} + ]; + + var comboBox = Qt.createQmlObject('import QtQuick.Controls 1.1 ; ComboBox { }', testCase, ''); + comboBox.textRole = "text" + comboBox.model = arrayModel compare(comboBox.currentIndex, 0) compare(comboBox.currentText, "Banana") comboBox.textRole = "color" |