diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2020-11-19 10:32:02 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2020-11-20 11:38:03 -0800 |
commit | 47778847ec103242ee95b01d502272d6a9879e9b (patch) | |
tree | ac566b37ecd4cdffae22e186b973f38bff872a3f /src/corelib/kernel/qcoreapplication.cpp | |
parent | 8ec9a48e80a72c7b9e82107a2c66de6cbf7a02fe (diff) |
QCoreApplication: add doc to discourage use of processEvents
Change-Id: If51855da004b4f3fbf43fffd1648fc580c00224a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.cpp')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 7c2cdd7516..8dc57c3a19 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1231,8 +1231,10 @@ bool QCoreApplication::closingDown() Processes some pending events for the calling thread according to the specified \a flags. - You can call this function occasionally when your program is busy - performing a long operation (e.g. copying a file). + Use of this function is discouraged. Instead, prefer to move long + operations out of the GUI thread into an auxiliary one and to completely + avoid nested event loop processing. If event processing is really + necessary, consider using \l QEventLoop instead. In the event that you are running a local loop which calls this function continuously, without an event loop, the @@ -1268,8 +1270,10 @@ void QCoreApplication::processEvents(QEventLoop::ProcessEventsFlags flags) milliseconds or until there are no more events to process, whichever is shorter. - You can call this function occasionally when your program is busy - doing a long operation (e.g. copying a file). + Use of this function is discouraged. Instead, prefer to move long + operations out of the GUI thread into an auxiliary one and to completely + avoid nested event loop processing. If event processing is really + necessary, consider using \l QEventLoop instead. Calling this function processes events only for the calling thread. |