diff options
author | Stephen Kelly <stephen.kelly@kdab.com> | 2012-02-11 01:33:55 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-16 01:56:27 +0100 |
commit | 66603985f2de74ac5f3bd5d259f0e65f710f62d7 (patch) | |
tree | 65049a5d31f1e8a978f60f5fc12d1dd26be73284 /src/gui/kernel/qguiapplication.cpp | |
parent | 90feedb6429df225b81bc279093ae1ca1278b391 (diff) |
Fix ref counted window close handling.
Instead of refcounting QWindow visibility, we ask the Application
subclass whether quitting is appropriate.
Task-Id: QTBUG-24120
Change-Id: Idd19cc1a3e5742fddded89c7638aaaa5e47c568d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 4d80aafea5..5f50fe343a 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1477,6 +1477,17 @@ void QGuiApplicationPrivate::emitLastWindowClosed() } } +bool QGuiApplicationPrivate::shouldQuit() +{ + /* if there is no visible top-level window left, we allow the quit */ + QWindowList list = QGuiApplication::topLevelWindows(); + for (int i = 0; i < list.size(); ++i) { + QWindow *w = list.at(i); + if (w->visible()) + return false; + } + return true; +} /*! \property QGuiApplication::layoutDirection |