From d2e8cebe210d558d4abba31eebfb83155e7e5009 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 26 Feb 2026 13:56:43 +0100 Subject: Fix all qmllint warnings in demo QML files - Add pragma ComponentBehavior: Bound to both QML files - Qualify unqualified property accesses with component id - Replace var logFunction property with logRequested signal - Fix layout-managed Rectangle to use implicitHeight - Register OpcUaNodeInfo gadget as QML_VALUE_TYPE --- demo/Main.qml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'demo/Main.qml') diff --git a/demo/Main.qml b/demo/Main.qml index 2cfa577..48af74a 100644 --- a/demo/Main.qml +++ b/demo/Main.qml @@ -1,5 +1,6 @@ // Main.qml — Demo app for Bobink library. // Connects to an OPC UA server, then pushes NodePage for node interaction. +pragma ComponentBehavior: Bound import QtQuick import QtQuick.Controls @@ -31,8 +32,7 @@ ApplicationWindow { Bobink.stopDiscovery(); stack.push("NodePage.qml", { stackRef: stack, - pageNumber: 1, - logFunction: debugConsole.appendLog + pageNumber: 1 }); } else { stack.pop(null); @@ -163,7 +163,7 @@ ApplicationWindow { Bobink.stopDiscovery(); } else { Bobink.discoveryUrl - = discoveryUrlField.text; + = discoveryUrlField.text; Bobink.startDiscovery(); } } @@ -216,8 +216,8 @@ ApplicationWindow { onClicked: { if (modelData.discoveryUrls.length > 0) - serverUrlField.text - = modelData.discoveryUrls[0]; + serverUrlField.text + = modelData.discoveryUrls[0]; } } } @@ -473,8 +473,8 @@ ApplicationWindow { Bobink.auth = auth; Bobink.serverUrl = serverUrlField.text; Bobink.connectDirect( - securityPolicyCombo.currentValue, - securityModeCombo.currentValue); + securityPolicyCombo.currentValue, + securityModeCombo.currentValue); } } @@ -483,6 +483,15 @@ ApplicationWindow { } } } + + Connections { + function onLogRequested(message) { + debugConsole.appendLog(message); + } + + ignoreUnknownSignals: true + target: stack.currentItem + } } Rectangle { -- cgit v1.2.3