summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Pocheptsov <[email protected]>2022-04-06 13:43:54 +0200
committerTimur Pocheptsov <[email protected]>2022-04-07 05:04:41 +0200
commita0470ec2617357293d13fa5ec2c87efbd3965b4c (patch)
tree37390383e55a6c5624d5e2b8acc0581fb7e3391c
parent6cbaf834a780c2b31cd90c72ad87eac8b74d7bfc (diff)
QProxyStyle: do not pass DeferredDelete to baseStyle
Calling deleteLater on an object of type QProxyStyle (or inheriting from QProxyStyle) results in this object never deleted, since it simply passes the event to its base style, which in case of deleteLater is not right. QProxyStyle inherits QCommonStyle which in turn inherits QStyle (which is QObject's descendent). So for the style to be deleted we pass DeferredDelete to its base class - QCommonStyle::event (which means QObject::event, since neither QCommonStyle nor QStyle override QObject::event()). Pick-to: 6.3 Fixes: QTBUG-96213 Change-Id: I99b8f413624e2f18ddae3fb331997f767de219d0 Reviewed-by: Friedemann Kleint <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
-rw-r--r--src/widgets/styles/qproxystyle.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp
index 31fe587ce26..f138bdda115 100644
--- a/src/widgets/styles/qproxystyle.cpp
+++ b/src/widgets/styles/qproxystyle.cpp
@@ -383,6 +383,10 @@ void QProxyStyle::unpolish(QApplication *app)
bool QProxyStyle::event(QEvent *e)
{
Q_D (QProxyStyle);
+
+ if (e->type() == QEvent::DeferredDelete)
+ return QCommonStyle::event(e);
+
d->ensureBaseStyle();
return d->baseStyle->event(e);
}