Fix the focus frame on Mac
The Mac style uses focus in/out events (sent by QApplication) in order
to update the focus frame. If a proxy style is installed, these events
never reach the Mac style object.
Amends 5d8a7652b9 , by making the
forwarding limited to the events for which we want it to happen, and not
just *any* event.
Fixes: QTBUG-109375
Change-Id: I6df49aa81d6ebb8dbaf00b9ba99e2a7c006e1181
Pick-to: 6.4 6.5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
bb10
parent
cc9144b4f3
commit
3bb055d8ab
|
|
@ -348,7 +348,18 @@ void QProxyStyle::unpolish(QApplication *app)
|
|||
*/
|
||||
bool QProxyStyle::event(QEvent *e)
|
||||
{
|
||||
// ### Qt 7: remove this override
|
||||
Q_D (QProxyStyle);
|
||||
|
||||
switch (e->type()) {
|
||||
// The Mac style relies on these events in order to set the focus frame
|
||||
case QEvent::FocusIn:
|
||||
case QEvent::FocusOut:
|
||||
d->ensureBaseStyle();
|
||||
return QApplication::sendEvent(d->baseStyle, e);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return QCommonStyle::event(e);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue