diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-08-20 10:41:06 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2021-08-24 13:32:07 +0200 |
commit | 01aeb5f7e4fd977e9698fffdc7650897664ecb82 (patch) | |
tree | dcb750389ec6cb2d903a8845c398ce5988291845 /src | |
parent | d48058f1970a795afb4cedaae54dde7ca69cb252 (diff) |
QGraphicsProxyWidget: forward Window(De)Activate events
The nested widget might be a QGraphicsView as well (documented to be
supported), and QGraphicsScene maintains it's own activation status by
counting Window(De)Activate events. We need to make sure that the
embedded widget is informed about its activation status so that deeper
nested children can receive focus.
Forward WindowActivate/Deactivate events to the nested widget, which
will pass it on to all its children. Add test case, which without this
fix fails when verifying the inner scene's isActive state, or later
when testing that focusInEvent is delivered to the embedded widget.
Fixes: QTBUG-94091
Pick-to: 5.15 6.1 6.2
Change-Id: I4e0ecef50685ed081d15c7f76b6c1a4a40ed2682
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsproxywidget.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp index 4d997b3443..cb19b32763 100644 --- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp +++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp @@ -832,6 +832,10 @@ bool QGraphicsProxyWidget::event(QEvent *event) return QGraphicsWidget::event(event); switch (event->type()) { + case QEvent::WindowActivate: + case QEvent::WindowDeactivate: + QCoreApplication::sendEvent(d->widget, event); + break; case QEvent::StyleChange: // Propagate style changes to the embedded widget. if (!d->styleChangeMode) { |