Fix rare PictureDialog crash issue
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Syping 2021-01-27 14:40:50 +01:00
parent dd7667b9f7
commit b8ad311912
1 changed files with 27 additions and 27 deletions

View File

@ -199,7 +199,7 @@ void PictureDialog::setupPictureDialog()
} }
installEventFilter(this); installEventFilter(this);
installEventFilter(ui->labPicture); // installEventFilter(ui->labPicture);
// DPI calculation // DPI calculation
ui->hlButtons->setSpacing(6 * screenRatio); ui->hlButtons->setSpacing(6 * screenRatio);
@ -214,32 +214,32 @@ void PictureDialog::setupPictureDialog()
PictureDialog::~PictureDialog() PictureDialog::~PictureDialog()
{ {
#ifdef Q_OS_WIN //#ifdef Q_OS_WIN
#if QT_VERSION >= 0x050200 //#if QT_VERSION >= 0x050200
if (naviEnabled) // if (naviEnabled)
{ // {
for (QObject *obj : layout()->menuBar()->children()) // for (QObject *obj : layout()->menuBar()->children())
{ // {
delete obj; // delete obj;
} // }
delete layout()->menuBar(); // delete layout()->menuBar();
} // }
#endif //#endif
#else //#else
if (naviEnabled) // if (naviEnabled)
{ // {
for (QObject *obj : layout()->menuBar()->children()) // for (QObject *obj : layout()->menuBar()->children())
{ // {
delete obj; // delete obj;
} // }
delete layout()->menuBar(); // delete layout()->menuBar();
} // }
#endif //#endif
for (QObject *obj : manageMenu->children()) // for (QObject *obj : manageMenu->children())
{ // {
delete obj; // delete obj;
} // }
delete manageMenu; // delete manageMenu;
delete ui; delete ui;
} }