diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-05-08 08:21:49 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-06-09 16:31:35 +0200 |
commit | 78acaf4fb6acfc51f8cc823e381e4cf593a715b7 (patch) | |
tree | 453a5dffa9a01cdad9b8a1d959a580c0a617a57f /tests/auto/widgets/kernel/qapplication | |
parent | 30e5ff3ff223d665fbed3baf2d08ad3fcf2b8455 (diff) |
Fix sending deferred delete events when posted before outermost loop
QDeferredDeleteEvent has the loopLevel field, which is a sum of
scope and loop levels found at posting. In sendPostedEvents however,
it is impossible to only use this information to find delete events
posted before the outermost loop (which should be handled by any loop)
based solely on this information, as the scope level essentialy removes
the information on loop level.
Break the loopLevel in two, storing both loop and scope levels in
QDeferredDeleteEvent, so that we can check whether an event was posted
before the outermost event loop (for which we need to compare only the
loop level).
QDeferredDeleteEvent was also made private as it should - it is an
implementation detail that wasn't hidden properly.
Change-Id: I0a607a0bd3a2deb5024acad67f740dbf4338574c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Diffstat (limited to 'tests/auto/widgets/kernel/qapplication')
-rw-r--r-- | tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 3ed9743838..fe98b4a9c1 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -19,6 +19,7 @@ #if QT_CONFIG(process) # include <QtCore/QProcess> #endif +#include <QtCore/private/qcoreevent_p.h> #include <QtCore/private/qeventloop_p.h> #include <QtGui/QFontDatabase> @@ -94,7 +95,9 @@ private slots: void libraryPaths_qt_plugin_path_2(); #endif +#ifdef QT_BUILD_INTERNAL void sendPostedEvents(); +#endif // ifdef QT_BUILD_INTERNAL void thread(); void desktopSettingsAware(); @@ -1126,6 +1129,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path_2() } #endif +#ifdef QT_BUILD_INTERNAL class SendPostedEventsTester : public QObject { Q_OBJECT @@ -1171,6 +1175,7 @@ void tst_QApplication::sendPostedEvents() (void) QCoreApplication::exec(); QVERIFY(p.isNull()); } +#endif void tst_QApplication::thread() { |