From e73fe498e86dbb20d74f8d6ca13b541642676b82 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 19 Feb 2026 18:00:52 +0100 Subject: Rename QML singleton to Bobink and simplify singleton lifecycle Replace QML_ELEMENT with QML_NAMED_ELEMENT(Bobink) so QML references use `Bobink` instead of `BobinkClient`. Remove instance()/create() factory in favor of inline s_instance set in the constructor. Import BobinkPlugin statically in demo, link demo to BobinkQtOpcUaplugin, and make library link dependencies PUBLIC. Add .qtcreator to gitignore. --- demo/main.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'demo/main.cpp') diff --git a/demo/main.cpp b/demo/main.cpp index b52df9e..6d0b9be 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -5,18 +5,20 @@ #include #include +#include +Q_IMPORT_QML_PLUGIN(BobinkPlugin) + int main(int argc, char *argv[]) { // Load the locally-built OpcUa backend plugin (open62541). QCoreApplication::addLibraryPath(QStringLiteral(QTOPCUA_PLUGIN_PATH)); QGuiApplication app(argc, argv); - QQmlApplicationEngine engine; - QObject::connect( - &engine, &QQmlApplicationEngine::objectCreationFailed, - &app, []() { QCoreApplication::exit(1); }, - Qt::QueuedConnection); + QQmlApplicationEngine engine; + QObject::connect ( + &engine, &QQmlApplicationEngine::objectCreationFailed, &app, + [] () { QCoreApplication::exit (1); }, Qt::QueuedConnection); engine.loadFromModule("BobinkDemo", "Main"); return app.exec(); -- cgit v1.2.3