Prevent potential crash when opening theme editor dialog. (#2359)

This commit is contained in:
karliss 2020-08-02 17:32:17 +03:00 committed by GitHub
parent 7c9c7e6fe4
commit 45daf2d1d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,7 +31,9 @@ ColorThemeEditDialog::ColorThemeEditDialog(QWidget *parent) :
previewDisasmWidget->setPreviewMode(true);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
// default size limit is acceptable
previewDisasmWidget->setMinimumSize(qApp->screenAt(previewDisasmWidget->pos())->size() * 0.5);
if (auto screen = qApp->screenAt(previewDisasmWidget->pos())) {
previewDisasmWidget->setMinimumSize(screen->size() * 0.5);
}
#endif
previewDisasmWidget->setWindowTitle(tr("Disassembly Preview"));
previewDisasmWidget->setFeatures(QDockWidget::NoDockWidgetFeatures);