diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-08-09 00:13:30 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-08-09 06:58:58 +0000 |
commit | b172b30368bafc839b92f767324496a509267fc7 (patch) | |
tree | c8c225227b8844bfa6c5cf1860844353b5ec7167 /tests/auto/controls/data/tst_combobox.qml | |
parent | 1b1df43976444d11519467d84891ee3ffe6fbaec (diff) |
ComboBox: ensure an update of the current text on data change
Task-number: QTBUG-55118
Change-Id: I4edcd660a35d8b8719fc4c09719332d088859ffc
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_combobox.qml')
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index d21e9900..29bf62c8 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -840,4 +840,24 @@ TestCase { control.destroy() } + + // QTBUG-55118 + function test_currentText() { + var control = comboBox.createObject(testCase, {model: listmodel}) + verify(control) + + compare(control.currentIndex, 0) + compare(control.currentText, "First") + + listmodel.setProperty(0, "text", "1st") + compare(control.currentText, "1st") + + control.currentIndex = 1 + compare(control.currentText, "Second") + + listmodel.setProperty(0, "text", "First") + compare(control.currentText, "Second") + + control.destroy() + } } |