diff options
author | John Tapsell <john.tapsell.ext@basyskom.de> | 2010-10-08 14:10:20 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-10-13 11:32:19 (GMT) |
commit | fcda1b785bd7d86011f49bfe96cb22b04202933f (patch) | |
tree | 5adaeba24330f730e86550fac0d8f58de9a598fa /src/gui/graphicsview/qgraphicslayoutitem.cpp | |
parent | 6d4d265e7e67dde58e45d7d89f4974d0bd8b70e4 (diff) | |
download | Qt-fcda1b785bd7d86011f49bfe96cb22b04202933f.zip Qt-fcda1b785bd7d86011f49bfe96cb22b04202933f.tar.gz Qt-fcda1b785bd7d86011f49bfe96cb22b04202933f.tar.bz2 |
QGraphicsLayoutItem - user set sizes should always override, even if there's a constraint
Notes:
* I have had to remove some of the old unit tests because the tested for
strange behaviour. Now that height for width items behave more like
normal items, it's no longer so easy to calculate what the geometries
should be in strangely-sized layouts.
* This also fixes alignment of height-for-width objects and adds a unit
test for this. This couldn't be done in a seperate commit since the two
fixes are related.
Merge-request: 847
Reviewed-by: Olivier Goffart
Diffstat (limited to 'src/gui/graphicsview/qgraphicslayoutitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicslayoutitem.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicslayoutitem.cpp b/src/gui/graphicsview/qgraphicslayoutitem.cpp index 634f68c..e43f7fa 100644 --- a/src/gui/graphicsview/qgraphicslayoutitem.cpp +++ b/src/gui/graphicsview/qgraphicslayoutitem.cpp @@ -140,11 +140,9 @@ QSizeF *QGraphicsLayoutItemPrivate::effectiveSizeHints(const QSizeF &constraint) if (!sizeHintCacheDirty && cachedConstraint == constraint) return cachedSizeHints; - const bool hasConstraint = constraint.width() >= 0 || constraint.height() >= 0; - for (int i = 0; i < Qt::NSizeHints; ++i) { cachedSizeHints[i] = constraint; - if (userSizeHints && !hasConstraint) + if (userSizeHints) combineSize(cachedSizeHints[i], userSizeHints[i]); } |