diff options
author | Daiwei Li <daiweili@suitabletech.com> | 2013-08-01 17:24:47 -0700 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-08-03 21:51:38 +0200 |
commit | bbf19fb29572785ef9b7fcccd2d2027f5c7603a6 (patch) | |
tree | 25e4d566a65158b96f308550c3079c93e64222c0 /src/widgets/kernel/qwidgetwindow.cpp | |
parent | 672fcbe9c6586e909513c91f5b36ad9a83a0ef1c (diff) |
Fix ignoring closeEvents on OSX for QtQuick.
The QCloseEvent's accepted state should not be inverted for the
QWindowSystemInterfacePrivate::CloseEvent. To make Widgets work
with this change, pass whether the close was accepted from close_helper
to the QCloseEvent generated by QGuiApplication.
Task-number: QTBUG-28965
Change-Id: If384b0355776b93df02dff2ab78b5647903200e7
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Josh Faust <jfaust@suitabletech.com>
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow.cpp')
-rw-r--r-- | src/widgets/kernel/qwidgetwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index 18dd3156c6..675ea77b30 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -538,9 +538,10 @@ void QWidgetWindow::handleResizeEvent(QResizeEvent *event) } } -void QWidgetWindow::handleCloseEvent(QCloseEvent *) +void QWidgetWindow::handleCloseEvent(QCloseEvent *event) { - m_widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent); + bool is_closing = m_widget->d_func()->close_helper(QWidgetPrivate::CloseWithSpontaneousEvent); + event->setAccepted(is_closing); } #ifndef QT_NO_WHEELEVENT |