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 <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
6cbaf834a7
commit
a0470ec261
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue