diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-02 15:06:16 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-07-02 15:06:16 (GMT) |
commit | ad910819812c100d300cfbf8f2de7cfe3105af03 (patch) | |
tree | c83471904eb4bcb547c3b8f5436e0abf5ccc88ce /src/gui/graphicsview/qgraphicsitem.cpp | |
parent | 1a38ba1dcd7629f74bcaed48793dff441c16dc8b (diff) | |
parent | ce4ed8fa50a72927d68c4c68c04a28d783546c07 (diff) | |
download | Qt-ad910819812c100d300cfbf8f2de7cfe3105af03.zip Qt-ad910819812c100d300cfbf8f2de7cfe3105af03.tar.gz Qt-ad910819812c100d300cfbf8f2de7cfe3105af03.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Removed missing symbols from DEF files.
Fixed missing clip when computing the graphics item effect source rect.
Diffstat (limited to 'src/gui/graphicsview/qgraphicsitem.cpp')
-rw-r--r-- | src/gui/graphicsview/qgraphicsitem.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 074e571..88e9952 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -1205,8 +1205,14 @@ void QGraphicsItemPrivate::setParentItemHelper(QGraphicsItem *newParent, const Q Returns the bounding rect of this item's children (excluding itself). */ -void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect) +void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rect, bool doClip) { + Q_Q(QGraphicsItem); + + QRectF childrenRect; + QRectF *result = rect; + rect = &childrenRect; + for (int i = 0; i < children.size(); ++i) { QGraphicsItem *child = children.at(i); QGraphicsItemPrivate *childd = child->d_ptr.data(); @@ -1228,6 +1234,15 @@ void QGraphicsItemPrivate::childrenBoundingRectHelper(QTransform *x, QRectF *rec childd->childrenBoundingRectHelper(x, rect); } } + + if (doClip && (flags & QGraphicsItem::ItemClipsChildrenToShape)){ + if (x) + *rect &= x->mapRect(q->boundingRect()); + else + *rect &= q->boundingRect(); + } + + *result |= *rect; } void QGraphicsItemPrivate::initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, @@ -10816,8 +10831,14 @@ QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem syste } QRectF rect = item->boundingRect(); - if (!item->d_ptr->children.isEmpty()) - rect |= item->childrenBoundingRect(); + if (!item->d_ptr->children.isEmpty()) { + if (dirtyChildrenBoundingRect) { + childrenBoundingRect = QRectF(); + item->d_ptr->childrenBoundingRectHelper(0, &childrenBoundingRect, true); + dirtyChildrenBoundingRect = false; + } + rect |= childrenBoundingRect; + } if (deviceCoordinates) { Q_ASSERT(info->painter); |