aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_combobox.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-06-06 20:40:54 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-06-06 21:41:33 +0200
commit026353c74a6343281045d42e717cd67e52aaf24c (patch)
tree1ad36ce6a7e57d10df808715981bf07c9a6462d6 /tests/auto/controls/data/tst_combobox.qml
parent0385c432962418431ec5fb4a80d57a5dd9926c6e (diff)
parent6b23b6b4507b42a96fb3fb7d2315523f54ce1ac0 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Fusion style ComboBox popup height was adjusted according to 90a0d402 to make tst_controls::ComboBox::test_emptyPopupAfterModelCleared pass with the Fusion style. Conflicts: src/imports/controls/ComboBox.qml src/imports/controls/material/ComboBox.qml src/imports/controls/universal/ComboBox.qml Change-Id: I2bad826dc56de9d8952ea2a9ace950c7cf3cbc58
Diffstat (limited to 'tests/auto/controls/data/tst_combobox.qml')
-rw-r--r--tests/auto/controls/data/tst_combobox.qml31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml
index 39a1d145..4f969106 100644
--- a/tests/auto/controls/data/tst_combobox.qml
+++ b/tests/auto/controls/data/tst_combobox.qml
@@ -80,6 +80,14 @@ TestCase {
}
}
+ function init() {
+ // QTBUG-61225: Move the mouse away to avoid QQuickWindowPrivate::flushFrameSynchronousEvents()
+ // delivering interfering hover events based on the last mouse position from earlier tests. For
+ // example, ComboBox::test_activation() kept receiving hover events for the last mouse position
+ // from CheckDelegate::test_checked().
+ mouseMove(testCase, testCase.width - 1, testCase.height - 1)
+ }
+
function test_defaults() {
var control = createTemporaryObject(comboBox, testCase)
verify(control)
@@ -1477,4 +1485,27 @@ TestCase {
compare(control.currentIndex, 0)
compare(control.currentText, "A")
}
+
+ function test_emptyPopupAfterModelCleared() {
+ var control = createTemporaryObject(comboBox, testCase, { model: 1 })
+ verify(control)
+ compare(control.popup.implicitHeight, 0)
+ compare(control.popup.height, control.popup.topPadding + control.popup.bottomPadding)
+
+ // Ensure that it's open so that the popup's implicitHeight changes when we increase the model count.
+ control.popup.open()
+ tryCompare(control.popup, "visible", true)
+
+ // Add lots of items to the model. The popup should take up the entire height of the window.
+ control.model = 100
+ compare(control.popup.height, control.Window.height - control.popup.topMargin - control.popup.bottomMargin)
+
+ control.popup.close()
+
+ // Clearing the model should result in a zero height.
+ control.model = 0
+ control.popup.open()
+ tryCompare(control.popup, "visible", true)
+ compare(control.popup.height, control.popup.topPadding + control.popup.bottomPadding)
+ }
}