MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / initEngine

Method initEngine

syncthingwidgets/quick/app.cpp:194–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194bool App::initEngine()
195{
196 if (!m_engine) {
197 qDebug() << "Initializing QML engine";
198 m_appEngine.emplace();
199 m_engine = &*m_appEngine;
200 connect(
201 &*m_appEngine, &QQmlApplicationEngine::objectCreated, m_app,
202 [](QObject *obj, const QUrl &objUrl) {
203 if (!obj) {
204 std::cerr << "Unable to load " << objUrl.toString().toStdString() << '\n';
205 QCoreApplication::exit(EXIT_FAILURE);
206 }
207 },
208 Qt::QueuedConnection);
209 connect(&*m_appEngine, &QQmlApplicationEngine::quit, m_app, &QGuiApplication::quit);
210 }
211 dataObjectToProperty(m_engine, &m_data);
212 dataObjectToProperty(m_engine, &m_models);
213 dataObjectToProperty(m_engine, &m_ui);
214 dataObjectToProperty(m_engine, this);
215 return loadMain();
216}
217
218#ifdef Q_OS_ANDROID
219bool App::destroyEngine()

Callers

nothing calls this directly

Calls 2

dataObjectToPropertyFunction · 0.85
toStringMethod · 0.80

Tested by

no test coverage detected