diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 2e44438fbd..1843acdc33 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -1748,13 +1748,8 @@ void Application::runApplication(void) std::map::const_iterator it; #if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0)) - QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); -#endif - - // A new QApplication - Base::Console().Log("Init: Creating Gui::Application and QApplication\n"); - -#if defined(QTWEBENGINE) && defined(Q_OS_LINUX) + QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts); +#elif defined(QTWEBENGINE) && defined(Q_OS_LINUX) // Avoid warning of 'Qt WebEngine seems to be initialized from a plugin...' // QTWEBENGINE is defined in src/Gui/CMakeLists.txt, currently only enabled // when build with Conda. @@ -1773,6 +1768,9 @@ void Application::runApplication(void) QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); #endif + // A new QApplication + Base::Console().Log("Init: Creating Gui::Application and QApplication\n"); + // if application not yet created by the splasher int argc = App::Application::GetARGC(); GUISingleApplication mainApp(argc, App::Application::GetARGV());