diff options
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 1cc2435239..590e2a85bb 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1922,9 +1922,6 @@ void QWindowPrivate::destroy() resizeEventPending = true; receivedExpose = false; exposed = false; - - if (wasVisible) - maybeQuitOnLastWindowClosed(); } /*! @@ -2313,8 +2310,17 @@ bool QWindow::event(QEvent *ev) #endif case QEvent::Close: - if (ev->isAccepted()) + if (ev->isAccepted()) { + Q_D(QWindow); + bool wasVisible = isVisible(); destroy(); + if (wasVisible) { + // FIXME: This check for visibility is a workaround for both QWidgetWindow + // and QWindow having logic to emit lastWindowClosed, and possibly quit the + // application. We should find a better way to handle this. + d->maybeQuitOnLastWindowClosed(); + } + } break; case QEvent::Expose: |