#include #include #include #include "PluginLoader.hpp" int main(int argc, char *argv[]) { QGuiApplication app(argc, argv); // 创建插件加载器 auto pluginLoader = new PluginLoader(&app); QQmlApplicationEngine engine; // 将插件加载器暴露给 QML engine.rootContext()->setContextProperty("pluginLoader", pluginLoader); QObject::connect( &engine, &QQmlApplicationEngine::objectCreationFailed, &app, []() { QCoreApplication::exit(-1); }, Qt::QueuedConnection); engine.loadFromModule("AuseftDDSPlugTest", "Main"); return app.exec(); }