MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / resetActivationWindow

Function resetActivationWindow

src/main.cpp:101–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99#ifdef MAPPER_USE_QTSINGLEAPPLICATION
100
101void resetActivationWindow(QtSingleApplication& app)
102{
103 const auto* const old_window = app.activationWindow();
104 app.setActivationWindow(nullptr);
105
106 if (!QCoreApplication::closingDown())
107 {
108 const auto top_level_widgets = QApplication::topLevelWidgets();
109 for (auto* widget : top_level_widgets)
110 {
111 auto* const new_window = qobject_cast<MainWindow*>(widget);
112 if (new_window && new_window != old_window)
113 {
114 app.setActivationWindow(new_window);
115 QObject::connect(new_window, &QObject::destroyed, &app, [&app]() { resetActivationWindow(app); });
116 QObject::connect(&app, &QtSingleApplication::messageReceived, new_window, &MainWindow::openPathLater);
117 break;
118 }
119 }
120 }
121}
122
123#endif
124

Callers 1

mainFunction · 0.85

Calls 2

activationWindowMethod · 0.80
setActivationWindowMethod · 0.80

Tested by

no test coverage detected