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>bb10
parent
672fcbe9c6
commit
bbf19fb295
|
|
@ -1778,7 +1778,7 @@ void QGuiApplicationPrivate::processCloseEvent(QWindowSystemInterfacePrivate::Cl
|
|||
QCloseEvent event;
|
||||
QGuiApplication::sendSpontaneousEvent(e->window.data(), &event);
|
||||
if (e->accepted) {
|
||||
*(e->accepted) = !event.isAccepted();
|
||||
*(e->accepted) = event.isAccepted();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue