diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2014-12-19 12:34:45 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-03-26 20:42:54 +0000 |
commit | 51af196ba098e38e3aa654031b237a948962d601 (patch) | |
tree | ac3b00b0e6f1a9fef7ccaec234a5f4f30e81cbe9 /src/widgets/kernel/qwidgetwindow.cpp | |
parent | d59638f21d7ea7c2a7f5c57b3eca27da984a1917 (diff) |
QWidgetWindow: use sendEvent to forward events to the wrapped QWidget
The fallback code for unhandled event types in QWidgetWindow::event
directly called event() on the underlying QWidget (i.e. m_widget->event(e)).
The problem with that approach is that it does not activate any
event filters that can have been installed on the top level widget.
Instead, let's use sendEvent to forward the event to the widget.
An extra modification becomes necessary:
the events received when creating/showing/etc. a widget change,
hence the corresponding test needs to be tuned. On the other hand,
apparently this fixes a long time XFAIL in that test.
Task-number: QTBUG-42281
Task-number: QTBUG-26424
Change-Id: I237bbbc301e3e9e10f071589629c71343a600ef9
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow.cpp')
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 12f5d4b8b0..5f0fb430bc 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -161,7 +161,7 @@ bool QWidgetWindow::event(QEvent *event) if (m_widget->testAttribute(Qt::WA_DontShowOnScreen)) { // \a event is uninteresting for QWidgetWindow, the event was probably // generated before WA_DontShowOnScreen was set - return m_widget->event(event); + return QCoreApplication::sendEvent(m_widget, event); } switch (event->type()) { @@ -303,7 +303,7 @@ bool QWidgetWindow::event(QEvent *event) break; } - if (m_widget->event(event) && event->type() != QEvent::Timer) + if (QCoreApplication::sendEvent(m_widget, event) && event->type() != QEvent::Timer) return true; return QWindow::event(event); |