diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2019-10-16 15:18:36 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2019-10-23 09:14:44 +0200 |
commit | da7f7af244e5f1f61ef7060b62b2e5c8d240701f (patch) | |
tree | c6591db0562fa9f3183f0cc2873f9815f4e805ab /tests/auto/controls/data/tst_splitview.qml | |
parent | 9685d8f97e8bb448c90dd87b4e86c0ea8438436a (diff) |
Fix assertion failure when hiding a SplitView with only one item
Check for -1 when calling handleIndexForSplitIndex().
Change-Id: I81021b64265ace0c47269ea54e538a2725c84b79
Fixes: QTBUG-79270
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_splitview.qml')
-rw-r--r-- | tests/auto/controls/data/tst_splitview.qml | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_splitview.qml b/tests/auto/controls/data/tst_splitview.qml index a03c09a0..bd36e898 100644 --- a/tests/auto/controls/data/tst_splitview.qml +++ b/tests/auto/controls/data/tst_splitview.qml @@ -1958,4 +1958,20 @@ TestCase { mouseRelease(targetHandle, -100, targetHandle.height / 2, Qt.LeftButton) verify(!control.resizing) } + + Component { + id: oneItemComponent + + SplitView { + Item {} + } + } + + // QTBUG-79270 + function test_hideSplitViewWithOneItem() { + var control = createTemporaryObject(oneItemComponent, testCase) + verify(control) + // Shouldn't be an assertion failure. + control.visible = false + } } |