diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-05-08 11:10:00 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-13 07:58:46 +0200 |
commit | c99b58a3dc69c6c649986bc3bdc4f7824c617c40 (patch) | |
tree | 1e067f7f8995ec6dda6d2a563df623b37dabef0c /src | |
parent | 32742959a29c3340c91eb33b733fc8c2439b53e5 (diff) |
Make handling of QEvent::Close consistent with QWindow::close()
The event handler would ignore the close if the window was hidden
while the close() function would not. In addition, the close()
function would force removal of focus etc while the event handler
did not. Make it consistent by calling close() from the event
handler.
Change-Id: Ia05b08299f218620fb40a8cad5d3771158c4701e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 4b36e5ca41..d4c1f2ade3 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1945,15 +1945,10 @@ bool QWindow::event(QEvent *ev) break; #endif - case QEvent::Close: { - Q_D(QWindow); - bool wasVisible = isVisible(); - if (ev->isAccepted()) { - destroy(); - if (wasVisible) - d->maybeQuitOnLastWindowClosed(); - } - break; } + case QEvent::Close: + if (ev->isAccepted()) + close(); + break; case QEvent::Expose: exposeEvent(static_cast<QExposeEvent *>(ev)); |