Set QT settings before creating QCoreApplication.

This commit is contained in:
Markus Lampert
2019-11-10 22:40:53 -08:00
committed by Yorik van Havre
parent 009b195258
commit 962ad2d053

View File

@@ -1761,14 +1761,23 @@ void Application::runApplication(void)
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
#endif
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
#endif
#if QT_VERSION >= 0x050600
//Enable automatic scaling based on pixel density of display (added in Qt 5.6)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#if QT_VERSION >= 0x050100
//Enable support for highres images (added in Qt 5.1, but off by default)
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
// if application not yet created by the splasher
int argc = App::Application::GetARGC();
GUISingleApplication mainApp(argc, App::Application::GetARGV());
// http://forum.freecadweb.org/viewtopic.php?f=3&t=15540
mainApp.setAttribute(Qt::AA_DontShowIconsInMenus, false);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 12, 0))
mainApp.setAttribute(Qt::AA_UseDesktopOpenGL);
#endif
#ifdef Q_OS_UNIX
// Make sure that we use '.' as decimal point. See also
@@ -1805,14 +1814,6 @@ void Application::runApplication(void)
return;
}
#if QT_VERSION >= 0x050600
//Enable automatic scaling based on pixel density of display (added in Qt 5.6)
mainApp.setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
#if QT_VERSION >= 0x050100
//Enable support for highres images (added in Qt 5.1, but off by default)
mainApp.setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
// set application icon and window title
it = cfg.find("Application");
if (it != cfg.end()) {