From 8ed452495c935b758de9aa628b2434ccf32969eb Mon Sep 17 00:00:00 2001 From: magdev Date: Sun, 3 May 2026 10:58:03 +0200 Subject: [PATCH] qml: silence DevConsole qmllint warnings (pragma + required property) Qt 6.5.3's qmllint exits 255 on these two warnings even though older qmllints only warn: - Outer-id access from a delegate (`width: view.width`) requires `pragma ComponentBehavior: Bound` to make the binding explicit. - Implicit role injection (`text: model.text`) should be a `required property`. Renamed the model role from "text" to "line" so the required property doesn't shadow Label's own `text`. Behaviour unchanged. Verified `make quality` from framework/skeleton green; the framework's `php_qml_bridge_qmllint` target now lints clean (no more warnings on DevConsole.qml). Co-Authored-By: Claude Opus 4.7 (1M context) --- framework/qml/qml/DevConsole.qml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/framework/qml/qml/DevConsole.qml b/framework/qml/qml/DevConsole.qml index aa8fb72..b42c13b 100644 --- a/framework/qml/qml/DevConsole.qml +++ b/framework/qml/qml/DevConsole.qml @@ -1,3 +1,5 @@ +pragma ComponentBehavior: Bound + import QtQuick import QtQuick.Controls import QtQuick.Layouts @@ -27,7 +29,7 @@ Rectangle { ListModel { id: lineModel } function append(line) { - lineModel.append({ "text": line }); + lineModel.append({ "line":line }); while (lineModel.count > maxLines) { lineModel.remove(0); } @@ -40,7 +42,7 @@ Rectangle { lineModel.clear(); const tail = BackendConnection.childLogTail(); for (let i = 0; i < tail.length; ++i) { - lineModel.append({ "text": tail[i] }); + lineModel.append({ "line":tail[i] }); } if (autoScroll.checked) { view.positionViewAtEnd(); @@ -114,8 +116,10 @@ Rectangle { ScrollBar.vertical: ScrollBar { policy: ScrollBar.AsNeeded } delegate: Label { + required property string line + width: view.width - text: model.text + text: line color: "#d6dee7" font.family: "monospace" font.pixelSize: 11