diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2014-04-10 16:46:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-28 13:34:24 +0200 |
commit | 7b5c79df9b5e6eea40bee48f188771fd19198893 (patch) | |
tree | dabb718c2365f0447235be82885297049b681217 /tests | |
parent | 38be2edc660e137ae549eb91d27cf1d14234149e (diff) | |
download | qtquickcontrols-7b5c79df9b5e6eea40bee48f188771fd19198893.tar.gz |
ComboBox: Update currentText when currentIndex goes from -1 to 0
We need to help things a bit because the internal selectedText property
won't change in that specific case.
Task-number: QTBUG-38036
Change-Id: Id997da97a77faad8ffaad08e8b9c7614d8b6b7fc
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_combobox.qml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 8910a30e..2052e676 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -698,6 +698,20 @@ TestCase { } } + function test_minusOneToZeroSelection_QTBUG_38036() { + var qmlObject = 'import QtQuick.Controls 1.2 ; ComboBox { model: ["A", "B", "C"] }' + var comboBox = Qt.createQmlObject(qmlObject, testCase, ''); + compare(comboBox.currentIndex, 0) + compare(comboBox.currentText, "A") + comboBox.currentIndex = -1 + compare(comboBox.currentIndex, -1) + compare(comboBox.currentText, "") + comboBox.currentIndex = 0 + compare(comboBox.currentIndex, 0) + compare(comboBox.currentText, "A") + comboBox.destroy() + } + function test_keys() { var component = Qt.createComponent("combobox/cb_keys.qml") compare(component.status, Component.Ready) |