Widgets: Deactivate effect on destruction

If a QGraphicsEffect is active during destruction, the corresponding
widget does not inform it's parent about this change which leads to
artefacts of the old effect. Therefore trigger an update through
effectBoundingRectChanged() if the graphics effect source changes.

Fixes: QTBUG-109165
Pick-to: 6.5 6.4
Change-Id: Ib3fd9bec2134ed61f098c4ce6629ebcc5df90787
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2022-12-12 20:25:06 +01:00 committed by Volker Hilsheimer
parent d238833a05
commit 2946447f50

View File

@ -121,6 +121,7 @@ public:
QGraphicsEffect::ChangeFlags flags;
if (source) {
flags |= QGraphicsEffect::SourceDetached;
source->d_func()->effectBoundingRectChanged();
source->d_func()->invalidateCache();
source->d_func()->detach();
delete source;