Gui: refactor Application::runApplication

This commit is contained in:
wmayer
2024-02-24 16:21:14 +01:00
committed by Chris Hennes
parent 45e33a7f12
commit 58a53e929d
6 changed files with 780 additions and 508 deletions

View File

@@ -48,6 +48,7 @@
#include <Gui/Application.h>
#include <Gui/BitmapFactory.h>
#include <Gui/MainWindow.h>
#include <Gui/StartupProcess.h>
#include <Gui/SoFCDB.h>
#include <Gui/Quarter/Quarter.h>
#include <Inventor/SoDB.h>
@@ -286,7 +287,8 @@ QWidget* setupMainWindow()
return nullptr;
}
Gui::initGuiAppPreMainWindow(true);
Gui::StartupProcess process;
process.execute();
Base::PyGILStateLocker lock;
// It's sufficient to create the config key
@@ -301,7 +303,9 @@ QWidget* setupMainWindow()
mw->setWindowIcon(qApp->windowIcon());
try {
Gui::initGuiAppPostMainWindow(true, *qApp, *mw, nullptr);
Gui::StartupPostProcess postProcess(mw, *Gui::Application::Instance, qApp);
postProcess.setLoadFromPythonModule(true);
postProcess.execute();
}
catch (const Base::Exception&) {
return nullptr;