diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-04-07 15:24:14 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2022-04-09 00:15:29 +0200 |
commit | 5d8a7652b995124495ef4f4a43fd8cf461367d62 (patch) | |
tree | ef60b841c8fa4f282cdb0c2326d5dc2f903f82ea | |
parent | 09e9f45933174d5b2ccb75e492d4ef4663e33fac (diff) |
QProxyStyle: reimplement event() handling
There is no use case for QProxyStyle to forward events to its base
style. QApplication does not send events to it; a style using e.g.
timers or so will have them active on *itself*, not on the proxy.
Moreover, forwarding *all* events is broken: QTBUG-96213 has been
triggered by forwarding DeferredDelete events sent to the proxy (thus
accidentally deleting the base style). But one can concoct many other
similarly broken situations; for instance, setting a proxy onto a base
style will make the style a child of the proxy. That sends a
QChildEvent to the proxy (ChildAdded), and that event is then passed on
the base style, resulting in the base style receiving an event saying
"you have yourself as a child".
Change-Id: I3b92bb168ce3c54a32469c36b6d1da4380ed564f
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/widgets/styles/qproxystyle.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/widgets/styles/qproxystyle.cpp b/src/widgets/styles/qproxystyle.cpp index f138bdda11..585177c30d 100644 --- a/src/widgets/styles/qproxystyle.cpp +++ b/src/widgets/styles/qproxystyle.cpp @@ -382,13 +382,8 @@ 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); + // ### Qt 7: remove this override + return QCommonStyle::event(e); } /*! |