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) <noreply@anthropic.com>
This commit is contained in:
2026-05-03 10:58:03 +02:00
parent 1389b92906
commit 8ed452495c

View File

@@ -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