QWindowPrivate::forwardToPopup() sends key events with QCoreApplication::sendEvent(), which sets QEvent::m_spont to false. That makes key and pointer events sent to popups appear synthetic, while they are sponaneous if sent to other widgets. The method has been newly implemented in the course of moving popup handling from QApplication to QGuiApplication. Make current behavior consistent to the behavior prior to e4ef0f03e6f1fddc397980fd7fbf6f6b829f16d9. Since events are always spontaneous, use QCoreApplication::sendSpontaneousEvent() instead. Add a test function to tst_QComboBox to Verify, that key events - are sent directly to the popup - not seen by the window - appear as spontaneous. This amends e4ef0f03e6f1fddc397980fd7fbf6f6b829f16d9. Fixes: QTBUG-129258 Pick-to: 6.8.0 Change-Id: Iff61b98b290f6483948007b5f12b19393759d9db Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3fbae61ea245291cb4c34e9126562c307741a600) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This directory contains autotests and benchmarks based on Qt Test. In order to run the autotests reliably, you need to configure a desktop to match the test environment that these tests are written for. Linux X11: * The user must be logged in to an active desktop; you can't run the autotests without a valid DISPLAY that allows X11 connections. * The tests are run against a KDE3 or KDE4 desktop. * Window manager uses "click to focus", and not "focus follows mouse". Many tests move the mouse cursor around and expect this to not affect focus and activation. * Disable "click to activate", i.e., when a window is opened, the window manager should automatically activate it (give it input focus) and not wait for the user to click the window.