aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2023-12-20 11:48:39 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-04-24 18:32:14 +0000
commita4fd57854c22ec0b45a0a84fbfe74a772e0fb286 (patch)
treee1a1e945fdebbba568a277ee8ae63ffea7fdbbeb
parentf58016227e4c251fb8cdf03e69dcc7b6a8f79f1b (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.6 6.5 Change-Id: I143f969596c6ee7ccd3d8607cfa53d539566a0b5 Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io> (cherry picked from commit 4b4bca359b129c52acda31d2575bbe909a30c70f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml14
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).
+ }
];
}