MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / initializeQmlInterface

Method initializeQmlInterface

app/src/Misc/ModuleManager.cpp:561–599  ·  view source on GitHub ↗

* @brief Initializes all application modules and loads the root QML file. */

Source from the content-addressed store, hash-verified

559 * @brief Initializes all application modules and loads the root QML file.
560 */
561void Misc::ModuleManager::initializeQmlInterface()
562{
563#ifdef ENABLE_GRPC
564 (void)API::GRPC::GRPCServer::instance();
565 const bool grpcAvailable = true;
566#else
567 const bool grpcAvailable = false;
568#endif
569
570 Misc::TimerEvents::instance().startTimers();
571
572 connect(&Misc::Translator::instance(),
573 &Misc::Translator::languageChanged,
574 &m_engine,
575 &QQmlApplicationEngine::retranslate);
576
577 setupCrossModuleConnections();
578
579 qInstallMessageHandler(MessageHandler);
580 qAddPostRoutine([]() { qInstallMessageHandler(nullptr); });
581
582 Platform::AppPlatform::registerIngestThreadWithMmcss();
583
584 const auto c = m_engine.rootContext();
585 registerCoreContextProperties(c);
586#ifdef BUILD_COMMERCIAL
587 registerCommercialContextProperties(c);
588#endif
589 registerAppMetadataProperties(c, grpcAvailable);
590
591 if (!m_headless)
592 registerImageProvidersAndLoadQml();
593
594#ifdef BUILD_COMMERCIAL
595 auto& lemonSqueezy = Licensing::LemonSqueezy::instance();
596 if (!lemonSqueezy.licensingData().isEmpty())
597 QMetaObject::invokeMethod(&lemonSqueezy, &Licensing::LemonSqueezy::validate);
598#endif
599}
600
601/**
602 * @brief Wires inter-module signals and runs each module's setupExternalConnections.

Callers 1

bootstrapModuleManagerFunction · 0.80

Calls 3

startTimersMethod · 0.80
isEmptyMethod · 0.80

Tested by

no test coverage detected