@@ -47,21 +47,13 @@ WindowManager::WindowManager() {
4747 translator = std::make_unique<QTranslator>();
4848}
4949
50- void WindowManager::runEventLoopIfNeeded () {
51- if (!QCoreApplication::instance ()->property (" _eventLoopRunning" ).toBool ()) {
52- QCoreApplication::instance ()->setProperty (" _eventLoopRunning" , true );
53- app->exec ();
54- QCoreApplication::instance ()->setProperty (" _eventLoopRunning" , false );
55- }
56- }
57-
5850void WindowManager::showExportPanelWindow () {
5951 init ();
6052 if (exportPanelWindow == nullptr ) {
6153 exportPanelWindow = std::make_unique<ExportPanelWindow>(app.get ());
6254 }
6355 exportPanelWindow->show ();
64- runEventLoopIfNeeded ();
56+ app-> exec ();
6557}
6658
6759void WindowManager::showPAGConfigWindow () {
@@ -70,7 +62,7 @@ void WindowManager::showPAGConfigWindow() {
7062 configWindow = std::make_unique<ConfigWindow>(app.get ());
7163 }
7264 configWindow->show ();
73- runEventLoopIfNeeded ();
65+ app-> exec ();
7466}
7567
7668void WindowManager::showExportPreviewWindow () {
@@ -80,7 +72,7 @@ void WindowManager::showExportPreviewWindow() {
8072 previewWindow = std::make_unique<ExportWindow>(app.get (), outputPath);
8173 }
8274 previewWindow->show ();
83- runEventLoopIfNeeded ();
75+ app-> exec ();
8476}
8577
8678void WindowManager::showExportWindow () {
@@ -89,7 +81,7 @@ void WindowManager::showExportWindow() {
8981 exportWindow = std::make_unique<ExportWindow>(app.get ());
9082 }
9183 exportWindow->show ();
92- runEventLoopIfNeeded ();
84+ app-> exec ();
9385}
9486
9587bool WindowManager::showWarnings (const std::vector<AlertInfo>& infos) {
@@ -142,7 +134,6 @@ void WindowManager::initializeQtEnvironment() {
142134 defaultFonts.setStyleHint (QFont::SansSerif);
143135 QApplication::setFont (defaultFonts);
144136#endif
145- QApplication::setApplicationName (" PAGExporter" );
146137 app = std::make_unique<QApplication>(argc, argv);
147138 app->setObjectName (" PAG-Exporter" );
148139 QQuickWindow::setGraphicsApi (QSGRendererInterface::OpenGL);
0 commit comments