Skip to content

Fix QML runtime type errors and add CI#2

Merged
derryl merged 6 commits intomainfrom
fix/qml-errors-and-ci
Feb 26, 2026
Merged

Fix QML runtime type errors and add CI#2
derryl merged 6 commits intomainfrom
fix/qml-errors-and-ci

Conversation

@derryl
Copy link
Owner

@derryl derryl commented Feb 26, 2026

Summary

  • Fix all Unable to assign [undefined] to QString runtime errors caused by font.family: root.fontFamily || undefined in LoginForm.qml and SessionSelector.qml
  • Make Preview.qml resilient to missing assets/background.jpg (falls back to solid color cleanly)
  • Rewrite preview.sh signal handling so Ctrl-C exits cleanly instead of segfaulting
  • Add scripts/lint-qml.sh combining qmllint static analysis + headless runtime type-error detection
  • Add GitHub Actions CI workflow (.github/workflows/ci.yml) that runs on every push and PR

Test plan

  • Run ./scripts/lint-qml.sh locally — both static and runtime checks should pass
  • Run ./scripts/preview.sh, verify no Unable to assign [undefined] errors in terminal output
  • Ctrl-C the preview — should print "Preview stopped." and return to shell cleanly
  • Verify CI workflow runs on this PR (check Actions tab)

🤖 Generated with Claude Code

derryl and others added 6 commits February 26, 2026 15:38
- Remove `|| undefined` from all font.family bindings — empty string
  already tells Qt to use the system default; `undefined` is not
  assignable to QString and produces runtime warnings
- Make preview background resilient to missing assets/background.jpg
- Rewrite preview.sh process management so Ctrl-C exits cleanly
  instead of segfaulting (background entr + tracked PID + proper trap)
- Add scripts/lint-qml.sh: runs qmllint static analysis and a
  headless runtime check (via xvfb) that catches type-assignment errors
- Add GitHub Actions CI workflow that runs on every push and PR

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Ship the JWST Carina Nebula image as the default background so the
preview works out of the box. Fix the mockConfig background path to
use Qt.resolvedUrl("../assets/...") so it resolves relative to the
project root rather than the preview/ subdirectory.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
The qmllint binary lives in qt6-declarative-dev-tools on Ubuntu,
not qt6-declarative-dev.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
Breeze's ComboBox.qml references T.Overlay which only exists inside a
full Plasma session, producing TypeError spam in standalone qml6 runs.
Setting QT_QUICK_CONTROLS_STYLE=Basic in both preview.sh and
lint-qml.sh avoids loading Breeze entirely. SDDM sets its own style at
runtime so this has no effect on the installed theme.

Also removes the grep filter that was silently swallowing Breeze errors
in lint-qml.sh — now that the root cause is fixed, any TypeError from
any source will correctly fail CI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
On Ubuntu, Qt 6 tools install to /usr/lib/qt6/bin/ (not on PATH) and
the QML runtime is named `qml` not `qml6`. The lint script now probes
common Qt 6 bin directories and tries both binary name variants,
making it work on both Arch and Ubuntu without hard-coded paths.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Install qml-qt6 which provides the `qml` runtime binary on Ubuntu
  (qt6-declarative-dev-tools only has qmllint/qmlformat/etc.)
- Make qmllint non-fatal on warnings — SDDM context properties (sddm,
  config, userModel, etc.) are injected at runtime and can't be resolved
  by static analysis. Only actual errors (syntax, unknown own-code types)
  will fail the check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@derryl derryl merged commit 061b5b8 into main Feb 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant