[skip ci] improve possibility to create a QApplication in a thread
This commit is contained in:
@@ -109,6 +109,9 @@ FreeCADGui_showMainWindow(PyObject * /*self*/, PyObject *args)
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 9, 0))
|
||||
QApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
|
||||
#endif
|
||||
// This only works well if the QApplication is the very first created instance
|
||||
// of a QObject. Otherwise the application lives in a different thread than the
|
||||
// main thread which will cause hazardous behaviour.
|
||||
QtApplication app(argc, argv);
|
||||
if (setupMainWindow()) {
|
||||
app.exec();
|
||||
|
||||
Reference in New Issue
Block a user