summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-05-24 17:55:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-27 12:38:53 +0200
commitcf366e8b862a616efd7c3d4683d59971f795d476 (patch)
treef0339308b1687e5c01ceca66f15f8ac8b7a42ae9 /src/widgets
parentc9e1c947d40c259b0fcd28fcfd85b001ee7c5b69 (diff)
Made sure items with preferred width of 0 could also stretch
If no stretch factors were specified, we used the preferred size as a stretch factor. Obviously, that didn't work if the preferred size was actually 0. This patch works around this by actually setting the stretch factor to 1.0 if this is the case. This should work fine in most cases, except for the case where there are also other items with a preferred size close to 0. In this case, the item with preferred size 0 will just grow faster than an item with e.g. preferred size 0.1. Task-number: QTBUG-31217 Change-Id: I966455da0bdd00308591c7f7cfbc4e134d423e57 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/graphicsview/qgridlayoutengine.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/graphicsview/qgridlayoutengine.cpp b/src/widgets/graphicsview/qgridlayoutengine.cpp
index b80612bc47..4f43a0a4ac 100644
--- a/src/widgets/graphicsview/qgridlayoutengine.cpp
+++ b/src/widgets/graphicsview/qgridlayoutengine.cpp
@@ -291,7 +291,7 @@ void QGridLayoutRowData::calculateGeometries(int start, int end, qreal targetSiz
int stretch = stretches[start + i];
if (sumStretches == 0) {
- if (hasIgnoreFlag) {
+ if (hasIgnoreFlag || sizes[i] == 0.0) {
factors[i] = (stretch < 0) ? 1.0 : 0.0;
} else {
factors[i] = (stretch < 0) ? sizes[i] : 0.0;