diff options
author | Jan Arve Sæther <jan-arve.saether@qt.io> | 2023-12-20 11:48:39 +0100 |
---|---|---|
committer | Jan Arve Sæther <jan-arve.saether@qt.io> | 2024-04-24 14:49:06 +0000 |
commit | 4b4bca359b129c52acda31d2575bbe909a30c70f (patch) | |
tree | 298be3ed024c6bfea621b36fc1a04791d007a1eb /tests | |
parent | 27300f19d153c3b0d36e4de259c325f0a331710a (diff) |
Do not assert when preferred{Width|Height} is infinity
This adds an autotest for the fix that landed in qtbase:
(2a95ecf7e81fbdcfad50f8a1dd5c62b120e2ec27)
Task-number: QTBUG-116577
Pick-to: 6.7 6.6 6.5
Change-Id: I143f969596c6ee7ccd3d8607cfa53d539566a0b5
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml index 63734d9d14..03c186fdb4 100644 --- a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml +++ b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml @@ -945,7 +945,19 @@ Item { }, layoutWidth: 0, expectedWidths: [0] - } + },{ + tag: "preferred_infinity", // Do not crash/assert when the preferred size is infinity + layout: { + type: "RowLayout", + items: [ + {minimumWidth: 10, preferredWidth: Number.POSITIVE_INFINITY, fillWidth: true}, + {minimumWidth: 20, preferredWidth: Number.POSITIVE_INFINITY, fillWidth: true}, + ] + }, + layoutWidth: 31, // Important that this is between minimum and preferred width of the layout. + expectedWidths: [10, 21] // The result here does not have to be exact. (This + // test is mostly concerned about not crashing). + } ]; } |