Skip to content

fix: load and colour correctly on Qt 6.12 - #9

Open
salmun-nister wants to merge 2 commits into
simoz:masterfrom
salmun-nister:fix/qt-6.12-qml-compat
Open

salmun-nister wants to merge 2 commits into
simoz:masterfrom
salmun-nister:fix/qt-6.12-qml-compat

Conversation

@salmun-nister

Copy link
Copy Markdown

Fix the widget on Qt 6.12: declare components in qmldir and qualify the palette

Fixes #8

Problem

Since Qt 6.12 (Omarchy 4.5) the widget does not load, and once it does, its
colours are undefined. Both are compatibility breaks introduced by 6.12; the
same tree was fine on 6.11.2.

Changes

1. qmldir declares the widget's components (0b21337)

Qt 6.12 treats an existing qmldir as the type namespace for its directory, so
files it does not list are no longer implicitly available. Only the
VesselService singleton was listed, which broke Radar.qml (its OfflineMap,
DetailMap, RadarLabels and ShipModel children) and therefore the whole
widget:

Widget.qml:453: Type Radar unavailable
Radar.qml:194: RadarLabels is not a type

Every component file is now listed, matching how qs.Commons/qmldir declares
its types.

2. Palette references are qualified (7a1507a)

QtQuick in 6.12 registers a C++ Color type (QQuickColor) which shadows the
qs.Commons Color singleton for unqualified references in the same file, so
Color.accent, Color.muted and Color.foreground all evaluated to
undefined:

Widget.qml:239: Unable to assign [undefined] to QColor

All 110 references across the 13 QML files now read Commons.Color.…, with
import qs.Commons as Commons added, which is what the shell's own surfaces
already do. The theme-change Connections element targets Commons.Color as
well, so it keeps its accentChanged/backgroundChanged handlers.

Verification

  • qmllint *.qml — clean
  • omarchy plugin validate . — exit 0
  • ./tests/run — unchanged; the change is QML-only
  • Live, on Qt 6.12.0 / Quickshell 0.3.2 / Omarchy 4.5: omarchy-restart-shell
    produces zero log lines for the plugin (previously ~1,800 failures), the bar
    icon renders, and the panel opens, draws the radar and receives AIS traffic
  • On Qt 6.11.2 the change is inert: Commons.Color is the same singleton, and
    the extra qmldir entries only make types that already resolved implicitly
    explicit

Notes for review

  • No behaviour, layout or protocol changes; the diff is the two compatibility
    fixes only.
  • qmllint and omarchy plugin validate both pass against the unfixed tree, so
    neither would have caught this. A headless load of Widget.qml in CI would.

Qt 6.12 treats an existing qmldir as the definitive type namespace for the
directory. With only the VesselService singleton declared, Radar.qml could no
longer resolve OfflineMap, DetailMap, RadarLabels or ShipModel, so the whole
widget failed to load:

  Widget.qml:453: Type Radar unavailable
  Radar.qml:194: RadarLabels is not a type

List every component file, matching how qs.Commons declares its singletons and
types.
Qt 6.12 registers a C++ Color type (QQuickColor) from QtQuick, which shadows
the qs.Commons Color singleton for unqualified references. Every Color.accent,
Color.muted and Color.foreground binding therefore resolved to undefined:

  Widget.qml:239: Unable to assign [undefined] to QColor

Import qs.Commons as Commons and qualify the palette references, as the shell's
own surfaces already do. Also point the theme-change Connections at
Commons.Color so it keeps its accentChanged/backgroundChanged handlers.
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.

Widget never loads on Qt 6.12: sibling components unresolvable and Color singleton shadowed

1 participant