From fcf7dc26cfeba290f4fb3ad6d4e3087bb8a66a9c Mon Sep 17 00:00:00 2001 From: magdev Date: Sun, 3 May 2026 11:05:17 +0200 Subject: [PATCH] qml: silence skeleton + todo Main.qml qmllint warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two warnings, two distinct kinds of fix: 1. `Item { width: 12 }` (skeleton:77) — explicit width on a layout-managed Item is undefined behaviour per qmllint. Replaced with `Item { Layout.preferredWidth: 12 }`, matching the pattern already used at line 85 (`Item { Layout.fillWidth: true }`). Real fix, not a suppression. 2. `target: SingleInstance` (skeleton:48, todo/Main.qml:220) — false positive. SingleInstance is intentionally a context property set by main() before the QML engine boots (see SingleInstance.h doc comment), so qmllint can't see it via static analysis. Disabled the `unqualified` warning at the call site with an inline `// qmllint disable unqualified` directive plus a one-line explanation comment above. (Note: the disable directive parses every word after `disable` as a category name, so the prose has to live on the previous line — found the hard way after qmllint complained about the "unknown category" of every English word in the explanation.) Verified `make quality` from framework/skeleton green (qmllint clean across both targets — `php_qml_bridge_qmllint` and `skeleton_qmllint` both build with zero warnings). Co-Authored-By: Claude Opus 4.7 (1M context) --- examples/todo/qml/Main.qml | 3 ++- framework/skeleton/qml/Main.qml | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/todo/qml/Main.qml b/examples/todo/qml/Main.qml index 170801a..ad15505 100644 --- a/examples/todo/qml/Main.qml +++ b/examples/todo/qml/Main.qml @@ -217,7 +217,8 @@ ApplicationWindow { } Connections { - target: SingleInstance + // SingleInstance is a context property set in main(); qmllint can't see it. + target: SingleInstance // qmllint disable unqualified function onLaunchArgsReceived(args) { window.requestActivate() } diff --git a/framework/skeleton/qml/Main.qml b/framework/skeleton/qml/Main.qml index a1175b6..68b14b2 100644 --- a/framework/skeleton/qml/Main.qml +++ b/framework/skeleton/qml/Main.qml @@ -45,7 +45,8 @@ ApplicationWindow { } Connections { - target: SingleInstance + // SingleInstance is a context property set in main(); qmllint can't see it. + target: SingleInstance // qmllint disable unqualified function onLaunchArgsReceived(args) { window.requestActivate() log.append("· launch args from peer: " + args.join(" ")) @@ -74,7 +75,7 @@ ApplicationWindow { } Label { text: "Backend: " + window._stateName(BackendConnection.connectionState) } - Item { width: 12 } + Item { Layout.preferredWidth: 12 } Rectangle { Layout.preferredWidth: 12; Layout.preferredHeight: 12; radius: 6