qt5base-lts/tests/auto
Christian Heimlich 10bc093d4f Add reentrancy guard for processEvents() in QProgressDialog::setValue()
Current implementation of QProgressDialog always calls
QCoreApplication::processEvents() when the user calls
QProgressDialog::setValue() if the PD is modal. For most cases this is
fine, but when using a Qt::WindowModal PD with setValue() connected to
a signal in another thread using Qt::QueuedConnection a reentrancy
issue is present if setValue() is triggered too frequently as the
execution of its previous call may not have finished. If this happens
too many times in a row a stack overflow will occur.

Current documentation notes this potential issue but offers no way it
avoid it while still using QProgressDialog (user must implement a
custom dialog) without resorting to using Qt::BlockingQueuedConnection,
which unnecessarily reduces performance.

Introduces the boolean reentrancy guard "processingEvents" that is
checked before calling QCoreApplication::processEvents() in a modal
PD when setValue() is used. It is set before the first call to
processEvents() and cleared after that call returns. This ensures that
only one invocation of processEvents() is possible from within
setValue() at a time, and thereby minimizes iterations of the main event
loop and eliminates the aforementioned stack overflow condition.

See - https://forum.qt.io/topic/118292/

Fixes: QTBUG-10561
Pick-to: 5.15
Change-Id: Ifa9b91cbb66881981356954ead0906bdc91fab60
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-09-21 03:19:55 -04:00
..
cmake CMake: Fix configuration of CMake tests in-build-tree 2020-07-20 18:12:23 +02:00
concurrent Remove most compiler warnings about missing overrides 2020-09-11 00:20:47 +02:00
corelib QMetaType: Allow registration of mutable views and register iterables 2020-09-19 11:14:36 +02:00
dbus Remove most compiler warnings about missing overrides 2020-09-11 00:20:47 +02:00
gui Rename is[Begin|Update|End]Event, reimplement in QWheelEvent 2020-09-17 19:03:24 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network CMake Build: Add qtnetwork docker testserver support 2020-09-17 00:11:04 +00:00
opengl Remove tst_QGL 2020-08-28 11:43:11 +02:00
other Purge Q_{STDLIB,COMPILER}_UNICODE_STRINGS 2020-09-14 09:47:51 +02:00
printsupport Fix compiler warnings about missing overrides 2020-09-13 21:03:31 +02:00
shared Remove most compiler warnings about missing overrides 2020-09-11 00:20:47 +02:00
sql Interbase: Handle EXECUTE BLOCK statements correctly 2020-09-13 16:39:06 +02:00
testlib Rename QLibraryInfo::location() to path() 2020-09-12 23:35:56 +02:00
tools Extend QSequentialIterable and add QAssociativeIterable 2020-09-19 11:14:30 +02:00
widgets Add reentrancy guard for processEvents() in QProgressDialog::setValue() 2020-09-21 03:19:55 -04:00
xml Remove the SAX parser from QtXml 2020-09-15 08:12:20 +02:00
.prev_CMakeLists.txt CMake: Fix building with -DQT_FEATURE_gui=OFF 2020-09-15 20:05:32 +02:00
auto.pro CMake: Get tests/auto/cmake tests working 2020-07-17 09:43:04 +02:00
CMakeLists.txt CMake: Fix building with -DQT_FEATURE_gui=OFF 2020-09-15 20:05:32 +02:00
network-settings.h Revert "QAbstractSocket: deprecate 'error' member-function" 2020-02-26 23:07:52 +03:00