Add the event loop quitlock feature to QtCore.
authorStephen Kelly <stephen.kelly@kdab.com>
Wed, 26 Oct 2011 11:29:51 +0000 (13:29 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 31 Jan 2012 22:22:15 +0000 (23:22 +0100)
commita512e210ac5b032c5fc2edf1ddf72e5a414485fd
tree0e9615f317fe5c24bd002155b205a01d5716a1d3
parent36a590c90ddab6fa438b7b54b05d89e8f9698a52
Add the event loop quitlock feature to QtCore.

A feature of a ref-counted quit (managed by a quit-lock class)
is added to both QEventLoop and QCoreApplication.

This allows, for example, an event loop to quit() when there is
no more work for it to do.

quitOnLastWindowClosed is implemented in terms of the refcount in
QCoreApplication so that jobs can be completed before the
application quits.

Change-Id: I14c8f4e7ee12bbf81a6e5849290d4c8ff37fa110
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
17 files changed:
src/corelib/kernel/qcoreapplication.cpp
src/corelib/kernel/qcoreapplication.h
src/corelib/kernel/qcoreapplication_p.h
src/corelib/kernel/qeventloop.cpp
src/corelib/kernel/qeventloop.h
src/corelib/kernel/qeventloop_p.h [new file with mode: 0644]
src/gui/kernel/qguiapplication.cpp
src/gui/kernel/qguiapplication_p.h
src/gui/kernel/qwindow.cpp
src/widgets/kernel/qapplication.cpp
src/widgets/kernel/qapplication_p.h
src/widgets/kernel/qwidget.cpp
tests/auto/corelib/kernel/qcoreapplication/qcoreapplication.pro
tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
tests/auto/corelib/kernel/qeventloop/qeventloop.pro
tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp
tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp