summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication.h
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2011-10-26 13:29:51 +0200
committerQt by Nokia <qt-info@nokia.com>2012-01-31 23:22:15 +0100
commita512e210ac5b032c5fc2edf1ddf72e5a414485fd (patch)
tree0e9615f317fe5c24bd002155b205a01d5716a1d3 /src/corelib/kernel/qcoreapplication.h
parent36a590c90ddab6fa438b7b54b05d89e8f9698a52 (diff)
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>
Diffstat (limited to 'src/corelib/kernel/qcoreapplication.h')
-rw-r--r--src/corelib/kernel/qcoreapplication.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/kernel/qcoreapplication.h b/src/corelib/kernel/qcoreapplication.h
index 45583a67fa..d1fba3b63c 100644
--- a/src/corelib/kernel/qcoreapplication.h
+++ b/src/corelib/kernel/qcoreapplication.h
@@ -71,6 +71,7 @@ class Q_CORE_EXPORT QCoreApplication : public QObject
Q_PROPERTY(QString applicationVersion READ applicationVersion WRITE setApplicationVersion)
Q_PROPERTY(QString organizationName READ organizationName WRITE setOrganizationName)
Q_PROPERTY(QString organizationDomain READ organizationDomain WRITE setOrganizationDomain)
+ Q_PROPERTY(bool quitLockEnabled READ isQuitLockEnabled WRITE setQuitLockEnabled)
Q_DECLARE_PRIVATE(QCoreApplication)
public:
@@ -160,6 +161,9 @@ public:
EventFilter setEventFilter(EventFilter filter);
bool filterEvent(void *message, long *result);
+ static bool isQuitLockEnabled();
+ static void setQuitLockEnabled(bool enabled);
+
public Q_SLOTS:
static void quit();
@@ -183,7 +187,7 @@ private:
void init();
static QCoreApplication *self;
-
+
Q_DISABLE_COPY(QCoreApplication)
friend class QEventDispatcherUNIXPrivate;