diff options
author | Alexis Menard <alexis.menard@nokia.com> | 2009-08-18 09:05:17 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@nokia.com> | 2009-08-18 09:05:17 (GMT) |
commit | 17d0bca7afab7432194db38609c7397bfd4806ae (patch) | |
tree | a3a490a242f3930ff66a7ccb6f989abce6019bf9 /src/gui/graphicsview | |
parent | f30e54f2e8f89ca2c92032457a98b3f98010ba44 (diff) | |
download | Qt-17d0bca7afab7432194db38609c7397bfd4806ae.zip Qt-17d0bca7afab7432194db38609c7397bfd4806ae.tar.gz Qt-17d0bca7afab7432194db38609c7397bfd4806ae.tar.bz2 |
Fix regression in clip path calculation for QGraphicsWidget.
This fixes a regression when computing the clip path for a
QGraphicsWidget that clip its children to its shape. The clip path cache
use the bounding rect which has a null width and height the very first
time on a QGraphicsWidget. This might happen as well for any item that
have a null width and height (e.g. QGraphicsRectItem before you set the
rect). We should do better in mainline by refactoring this clip path
cache and calling it in prepareGeometryChange which should be called
when you update the shape and the boundingRect of the item. Do we
really need also in 4.6/mainline the clip path as it is now? This should
be investigate also. The auto-test cover the problem so we can use it
after for refactoring the cached clip path.
Task-number: 257232
Reviewed-by: andreas
Reviewed-by: bnilsen
Diffstat (limited to 'src/gui/graphicsview')
-rw-r--r-- | src/gui/graphicsview/qgraphicswidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/graphicsview/qgraphicswidget.cpp b/src/gui/graphicsview/qgraphicswidget.cpp index d52337d..525cf29 100644 --- a/src/gui/graphicsview/qgraphicswidget.cpp +++ b/src/gui/graphicsview/qgraphicswidget.cpp @@ -411,6 +411,8 @@ void QGraphicsWidget::setGeometry(const QRectF &rect) QSizeF oldSize = size(); QGraphicsLayoutItem::setGeometry(newGeom); + wd->invalidateCachedClipPathRecursively(); + // Send resize event bool resized = newGeom.size() != oldSize; if (resized) { |