aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_checkbox.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-10-26 07:48:54 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2017-10-26 08:23:47 +0000
commit339ddd4fc70bbb75aec63db0429c6f5900a609f4 (patch)
treeede847b3f5cb7790a49fed633dca46fdf1654c90 /tests/auto/controls/data/tst_checkbox.qml
parent459842c6d880c1a754829b258d4ca4d1a136cdb9 (diff)
QQuickCheckBox: don't force tristate when partially checked
This allows a parent node to present partially checked state of child nodes without being interactively a tri-state box. [ChangeLog][Important Behavior Changes] CheckBox no longer forces tristate to true when setting checkState to Qt.PartiallyChecked. This allows a checkbox to present a partially checked state without being interactively a tri-state checkbox. Task-number: QTBUG-56295 Change-Id: Ie392d1955b922e0e5c3db4ef24b3abb0191ce519 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_checkbox.qml')
-rw-r--r--tests/auto/controls/data/tst_checkbox.qml11
1 files changed, 6 insertions, 5 deletions
diff --git a/tests/auto/controls/data/tst_checkbox.qml b/tests/auto/controls/data/tst_checkbox.qml
index 5f36b00c..55de90dc 100644
--- a/tests/auto/controls/data/tst_checkbox.qml
+++ b/tests/auto/controls/data/tst_checkbox.qml
@@ -387,12 +387,14 @@ TestCase {
compare(container.cb2.checked, true)
compare(container.cb2.checkState, Qt.PartiallyChecked)
- compare(container.cb1.tristate, true)
- compare(container.cb2.tristate, true)
+ // note: since Qt Quick Controls 2.4 (Qt 5.11), CheckBox does not
+ // force tristate when checkState is set to Qt.PartiallyChecked
+ compare(container.cb1.tristate, false)
+ compare(container.cb2.tristate, false)
}
function test_tristate() {
- var control = createTemporaryObject(checkBox, testCase)
+ var control = createTemporaryObject(checkBox, testCase, {tristate: true})
var sequenceSpy = signalSequenceSpy.createObject(control, {target: control})
@@ -400,14 +402,13 @@ TestCase {
control.forceActiveFocus()
verify(control.activeFocus)
- compare(control.tristate, false)
+ compare(control.tristate, true)
compare(control.checked, false)
compare(control.checkState, Qt.Unchecked)
sequenceSpy.expectedSequence = [["checkStateChanged", { "pressed": false, "checked": true, "checkState": Qt.PartiallyChecked }],
["checkedChanged", { "pressed": false, "checked": true, "checkState": Qt.PartiallyChecked }]]
control.checkState = Qt.PartiallyChecked
- compare(control.tristate, true)
compare(control.checked, true)
compare(control.checkState, Qt.PartiallyChecked)
verify(sequenceSpy.success)