diff options
| author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-05-22 21:32:27 +0200 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-23 14:36:02 +0200 |
| commit | a6b01ff80139247ee2c4b41e9ebcf3694d83514b (patch) | |
| tree | 7a1645b81309a358739fbd215a172900b7e3772e /src | |
| parent | 1c98fb768afcc5d7d689073c2a8146fc2fcb860a (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: Id5a3e19c9cd756860fc4052daee3eb5582f39d0c
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/layouts/qgridlayoutengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/layouts/qgridlayoutengine.cpp b/src/layouts/qgridlayoutengine.cpp index d091d124e..bba1efbd0 100644 --- a/src/layouts/qgridlayoutengine.cpp +++ b/src/layouts/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; |
