summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-12-14 18:55:43 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-12-14 18:55:43 (GMT)
commita068f6dd6115b2f950892e5228efe10b7de57a00 (patch)
treec55c44b2e1b452838a7443d85ca2463ca1ec15bd /src/gui/kernel/qwidget.cpp
parentad4ca2152c161f7023e5febcf9e90c0652b8e57d (diff)
parentadba8e01f0069d240bf0b97175f54e38271acd19 (diff)
downloadQt-a068f6dd6115b2f950892e5228efe10b7de57a00.zip
Qt-a068f6dd6115b2f950892e5228efe10b7de57a00.tar.gz
Qt-a068f6dd6115b2f950892e5228efe10b7de57a00.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/gui/kernel/qwidget.cpp')
-rw-r--r--src/gui/kernel/qwidget.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 06d52ae..e551a1d 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -5046,6 +5046,8 @@ QGraphicsEffect *QWidget::graphicsEffect() const
If \a effect is the installed on a different widget, setGraphicsEffect() will remove
the effect from the widget and install it on this widget.
+ QWidget takes ownership of \a effect.
+
\note This function will apply the effect on itself and all its children.
\since 4.6
@@ -5059,28 +5061,22 @@ void QWidget::setGraphicsEffect(QGraphicsEffect *effect)
if (d->graphicsEffect == effect)
return;
- if (d->graphicsEffect && effect) {
+ if (d->graphicsEffect) {
+ d->invalidateBuffer(rect());
delete d->graphicsEffect;
d->graphicsEffect = 0;
}
- if (!effect) {
- // Unset current effect.
- QGraphicsEffectPrivate *oldEffectPrivate = d->graphicsEffect->d_func();
- d->graphicsEffect = 0;
- if (oldEffectPrivate) {
- oldEffectPrivate->setGraphicsEffectSource(0); // deletes the current source.
- }
- } else {
+ if (effect) {
// Set new effect.
QGraphicsEffectSourcePrivate *sourced = new QWidgetEffectSourcePrivate(this);
QGraphicsEffectSource *source = new QGraphicsEffectSource(*sourced);
d->graphicsEffect = effect;
effect->d_func()->setGraphicsEffectSource(source);
+ update();
}
d->updateIsOpaque();
- update();
}
#endif //QT_NO_GRAPHICSEFFECT