Fix MacOS regression QWidget::closeEvent called twice.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-04-03 17:41:39 +03:00
parent e880d5f0a3
commit c6e7590034
2 changed files with 18 additions and 0 deletions

View File

@ -519,6 +519,15 @@ void TMainWindow::ToolBarStyles()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void TMainWindow::closeEvent(QCloseEvent *event) void TMainWindow::closeEvent(QCloseEvent *event)
{ {
#if defined(Q_OS_MAC)
// Workaround for Qt bug https://bugreports.qt.io/browse/QTBUG-43344
static int numCalled = 0;
if (numCalled++ >= 1)
{
return;
}
#endif
if (MaybeSave()) if (MaybeSave())
{ {
WriteSettings(); WriteSettings();

View File

@ -1508,6 +1508,15 @@ void MainWindow::changeEvent(QEvent *event)
*/ */
void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::closeEvent(QCloseEvent *event)
{ {
#if defined(Q_OS_MAC)
// Workaround for Qt bug https://bugreports.qt.io/browse/QTBUG-43344
static int numCalled = 0;
if (numCalled++ >= 1)
{
return;
}
#endif
qCDebug(vMainWindow, "Closing main window"); qCDebug(vMainWindow, "Closing main window");
if (MaybeSave()) if (MaybeSave())
{ {