summaryrefslogtreecommitdiffstats
path: root/src/gui/effects
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-01 13:22:21 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-09-01 13:41:00 (GMT)
commit8abc68d262c40c1f035a2d77779e76f038261a89 (patch)
tree196738718f4c4f2148b5a0dbc9dc444e0bf1655d /src/gui/effects
parentdcdbb81f28bc8fc4bb7fedf78421e473413da1a7 (diff)
downloadQt-8abc68d262c40c1f035a2d77779e76f038261a89.zip
Qt-8abc68d262c40c1f035a2d77779e76f038261a89.tar.gz
Qt-8abc68d262c40c1f035a2d77779e76f038261a89.tar.bz2
Make sure the BSP is updated when a graphics effect changes bounding rect.
In the case of applying an effect to a QGraphicsItem, we have to notify the scene's BSP that the item's bounding rect has changed. We do this by calling prepareGeometryChange(). In the case of QWidget, it's sub-optimal that we update its parent, but there's no other way to solve it at the moment.
Diffstat (limited to 'src/gui/effects')
-rw-r--r--src/gui/effects/qgraphicseffect.cpp4
-rw-r--r--src/gui/effects/qgraphicseffect_p.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/effects/qgraphicseffect.cpp b/src/gui/effects/qgraphicseffect.cpp
index 2be6a49..6624cfb 100644
--- a/src/gui/effects/qgraphicseffect.cpp
+++ b/src/gui/effects/qgraphicseffect.cpp
@@ -335,7 +335,7 @@ void QGraphicsEffect::setEnabled(bool enable)
d->isEnabled = enable;
if (d->source)
- d->source->update();
+ d->source->d_func()->effectBoundingRectChanged();
emit enabledChanged(enable);
}
@@ -390,7 +390,7 @@ void QGraphicsEffect::updateBoundingRect()
{
Q_D(QGraphicsEffect);
if (d->source)
- d->source->update();
+ d->source->d_func()->effectBoundingRectChanged();
}
/*!
diff --git a/src/gui/effects/qgraphicseffect_p.h b/src/gui/effects/qgraphicseffect_p.h
index bfabfc0..24b605f 100644
--- a/src/gui/effects/qgraphicseffect_p.h
+++ b/src/gui/effects/qgraphicseffect_p.h
@@ -76,6 +76,7 @@ public:
virtual void update() = 0;
virtual bool isPixmap() const = 0;
virtual QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset = 0) const = 0;
+ virtual void effectBoundingRectChanged() = 0;
friend class QGraphicsScenePrivate;
friend class QGraphicsItem;
friend class QGraphicsItemPrivate;