diff options
| author | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-26 13:56:43 +0100 |
|---|---|---|
| committer | Thomas Vanbesien <tvanbesi@proton.me> | 2026-02-26 13:56:43 +0100 |
| commit | d2e8cebe210d558d4abba31eebfb83155e7e5009 (patch) | |
| tree | d218f9e6e12adda1595d28acaa00bd25e5eaf755 /demo/Main.qml | |
| parent | 7bb49eabdf8d86567660c8825892eb323fa6e674 (diff) | |
| download | BobinkQtOpcUa-d2e8cebe210d558d4abba31eebfb83155e7e5009.tar.gz BobinkQtOpcUa-d2e8cebe210d558d4abba31eebfb83155e7e5009.zip | |
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
Diffstat (limited to 'demo/Main.qml')
| -rw-r--r-- | demo/Main.qml | 23 |
1 files changed, 16 insertions, 7 deletions
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 { |
