aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorJan Arve Sæther <jan-arve.saether@qt.io>2018-02-27 10:35:33 +0100
committerJan Arve Sæther <jan-arve.saether@qt.io>2018-03-02 11:51:24 +0000
commit6479eb1967135b3b9d7c3b90501623c23d5cefa9 (patch)
tree7f5268dd8937af41c94d777e6eade544fa82defe /tests/auto/quick
parenta0d615e3b6c36a6918f27c7b53081a2f53043e9b (diff)
Add testcase for how align-to-pixel affects size hint normalization
Change-Id: I404b06daa5202f6cca887dc63dc4c86d432dd1e5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
index c014c2ef74..763c4cf6e4 100644
--- a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
+++ b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
@@ -570,6 +570,23 @@ Item {
{ tag: "expandPrefToExplicitMin", layoutHints: [24, -1, -1], childHints: [11, 21, 31], expected:[24, 24, 31]},
{ tag: "boundPrefToExplicitMax", layoutHints: [-1, -1, 19], childHints: [11, 21, 31], expected:[11, 19, 19]},
{ tag: "boundAllToExplicitMax", layoutHints: [-1, -1, 9], childHints: [11, 21, 31], expected:[ 9, 9, 9]},
+
+ /**
+ * Test how fractional size hint values are rounded. Some hints are ceiled towards the closest integer.
+ * Note some of these tests are not authorative, but are here to demonstrate current behavior.
+ * To summarize, it seems to be:
+ * - min: always ceiled
+ * - pref: Ceils only implicit (!) hints. Might also be ceiled if explicit
+ preferred size is less than implicit minimum size, but that's just a
+ side-effect of that preferred should never be less than minimum.
+ (tag "ceilShrinkMinToPref" below)
+ * - max: never ceiled
+ */
+ { tag: "ceilImplicitMin", layoutHints: [ -1, -1, -1], childHints: [ .1, 1.1, 9.1], expected:[ 1, 2, 9.1]},
+ { tag: "ceilExplicitMin", layoutHints: [1.1, -1, -1], childHints: [ .1, 2.1, 9.1], expected:[ 2, 3, 9.1]},
+ { tag: "ceilImplicitMin2", layoutHints: [ -1, 4.1, -1], childHints: [ .1, 1.1, 9.1], expected:[ 1, 4.1, 9.1]},
+ { tag: "ceilShrinkMinToPref", layoutHints: [ -1, 2.1, -1], childHints: [ 5, 6.1, 8.1], expected:[ 3, 3, 8.1]},
+ { tag: "ceilExpandMaxToPref", layoutHints: [ -1, 6.1, -1], childHints: [1.1, 3.1, 3.1], expected:[ 2, 6.1, 6.1]},
];
}