From 4b7ba7d5209a041b85abf1e335ad7aceb2158454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Nilsen?= Date: Thu, 30 Jul 2009 01:51:29 +0200 Subject: Small optimization to QGraphicsEffectSource::boundingRect. Don't bother asking for the childrenBoundingRect if the item has no children. --- src/gui/graphicsview/qgraphicsitem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp index 5178d80..b26e038 100644 --- a/src/gui/graphicsview/qgraphicsitem.cpp +++ b/src/gui/graphicsview/qgraphicsitem.cpp @@ -9995,7 +9995,8 @@ int QGraphicsItemGroup::type() const QRectF QGraphicsItemEffectSourcePrivate::boundingRect(Qt::CoordinateSystem system) const { QRectF rect = item->boundingRect(); - rect |= item->childrenBoundingRect(); + if (!item->d_ptr->children.isEmpty()) + rect |= item->childrenBoundingRect(); if (info && system == Qt::DeviceCoordinates) { Q_ASSERT(info->transformPtr); return info->transformPtr->mapRect(rect); -- cgit v0.12