Add QEventLoop::ProcessEventsFlag::ApplicationExec

The wasm event dispatcher needs to differentiate between
top-level QCoreApplication::exec() and QEventLoop::exec()
calls.

Add the “ApplicationExec” enum value. The value is
undocumented, like EventLoopExec and DialogExec.

Change-Id: I2924daee39ef85a3ea7e766e317b3071b5d7f541

Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Morten Johan Sørvig 2021-10-08 17:17:44 +02:00
parent f5eda09a63
commit e3a5bd3e55
3 changed files with 4 additions and 2 deletions

View File

@ -1381,7 +1381,7 @@ int QCoreApplication::exec()
QEventLoop eventLoop; QEventLoop eventLoop;
self->d_func()->in_exec = true; self->d_func()->in_exec = true;
self->d_func()->aboutToQuitEmitted = false; self->d_func()->aboutToQuitEmitted = false;
int returnCode = eventLoop.exec(); int returnCode = eventLoop.exec(QEventLoop::ApplicationExec);
threadData->quitNow = false; threadData->quitNow = false;
if (self) if (self)

View File

@ -88,6 +88,7 @@ QT_BEGIN_NAMESPACE
\omitvalue X11ExcludeTimers \omitvalue X11ExcludeTimers
\omitvalue EventLoopExec \omitvalue EventLoopExec
\omitvalue DialogExec \omitvalue DialogExec
\omitvalue ApplicationExec
\sa processEvents() \sa processEvents()
*/ */

View File

@ -62,7 +62,8 @@ public:
WaitForMoreEvents = 0x04, WaitForMoreEvents = 0x04,
X11ExcludeTimers = 0x08, X11ExcludeTimers = 0x08,
EventLoopExec = 0x20, EventLoopExec = 0x20,
DialogExec = 0x40 DialogExec = 0x40,
ApplicationExec = 0x80,
}; };
Q_DECLARE_FLAGS(ProcessEventsFlags, ProcessEventsFlag) Q_DECLARE_FLAGS(ProcessEventsFlags, ProcessEventsFlag)