Revision control

++ <?xml version="1.0" encoding="UTF-8"?>
++ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 900 720" width="900" height="720"
++ font-family="'Segoe UI', Arial, sans-serif">
++
++ <defs>
++ <marker id="ah" viewBox="0 0 10 10" refX="10" refY="5"
++ markerWidth="6" markerHeight="6" orient="auto">
++ <path d="M 0 1 L 10 5 L 0 9 z" fill="#94a3b8"/>
++ </marker>
++ </defs>
++
++ <!-- Page background -->
++ <rect width="900" height="720" fill="#f8fafc" rx="10"/>
++
++ <!-- Title -->
++ <text x="450" y="30" text-anchor="middle" font-size="15" font-weight="bold" fill="#0f172a">Qt Quick Palette System — Color Resolution</text>
++ <text x="450" y="48" text-anchor="middle" font-size="10.5" fill="#64748b">Highest priority at the top. For each unset brush role the value falls through to the next layer below.</text>
++
++ <!-- Priority arrow on far left -->
++ <line x1="16" y1="575" x2="16" y2="68" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++ <text font-size="9.5" fill="#94a3b8" transform="translate(10,390) rotate(-90)" text-anchor="middle">Priority</text>
++
++
++ <!-- ══════════════════════════════════════════════════
++ MAIN COLUMN x=32 .. 524 w=492
++ ══════════════════════════════════════════════════ -->
++
++ <!-- 1 · Direct color: binding (highest priority) -->
++ <rect x="32" y="62" width="492" height="44" rx="5" fill="#bbf7d0" stroke="#4ade80" stroke-width="1.5"/>
++ <text x="278" y="80" text-anchor="middle" font-size="12" font-weight="bold" fill="#14532d">Direct color: binding in QML</text>
++ <text x="278" y="97" text-anchor="middle" font-size="10.5" fill="#166534">e.g. color: "steelblue" or color: Qt.rgba(…) — always wins regardless of palette</text>
++
++ <line x1="278" y1="106" x2="278" y2="126" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- 2 · Item.palette property -->
++ <rect x="32" y="128" width="492" height="58" rx="5" fill="#d1fae5" stroke="#6ee7b7" stroke-width="1.5"/>
++ <text x="278" y="146" text-anchor="middle" font-size="12" font-weight="bold" fill="#065f46">Item.palette property (QML / C++)</text>
++ <text x="278" y="162" text-anchor="middle" font-size="10.5" fill="#047857">Set directly on an item; resolved roles propagate to all descendants.</text>
++ <text x="278" y="178" text-anchor="middle" font-size="10.5" fill="#047857">Unset roles are inherited lazily from the parent's palette, walking up to QQuickWindow.</text>
++
++ <line x1="278" y1="186" x2="278" y2="206" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- 3 · conf file -->
++ <rect x="32" y="208" width="492" height="58" rx="5" fill="#ede9fe" stroke="#c4b5fd" stroke-width="1.5"/>
++ <text x="278" y="226" text-anchor="middle" font-size="12" font-weight="bold" fill="#4c1d95">qtquickcontrols2.conf / QT_QUICK_CONTROLS_CONF</text>
++ <text x="278" y="242" text-anchor="middle" font-size="10.5" fill="#5b21b6">Parsed by QQuickStylePlugin::createTheme() at style load time.</text>
++ <text x="278" y="258" text-anchor="middle" font-size="10.5" fill="#5b21b6">Brushes set here are marked resolved in QQuickTheme, overriding the style's own palette.</text>
++
++ <line x1="278" y1="266" x2="278" y2="286" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- 4 · QGuiApplication::setPalette -->
++ <rect x="32" y="288" width="492" height="58" rx="5" fill="#dbeafe" stroke="#93c5fd" stroke-width="1.5"/>
++ <text x="278" y="306" text-anchor="middle" font-size="12" font-weight="bold" fill="#1e3a8a">QGuiApplication::setPalette()</text>
++ <text x="278" y="322" text-anchor="middle" font-size="10.5" fill="#1e40af">Explicitly resolved brush roles propagate to Qt Quick via ApplicationPaletteChange events.</text>
++ <text x="278" y="338" text-anchor="middle" font-size="10.5" fill="#1e40af">Only roles with their resolveMask bit set override the layers below.</text>
++
++ <line x1="278" y1="346" x2="278" y2="366" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- 5 · QStyle::polish -->
++ <rect x="32" y="368" width="492" height="58" rx="5" fill="#bfdbfe" stroke="#60a5fa" stroke-width="1.5"/>
++ <text x="278" y="386" text-anchor="middle" font-size="12" font-weight="bold" fill="#1e3a8a">QStyle::polish(QPalette &amp;)</text>
++ <text x="278" y="402" text-anchor="middle" font-size="10.5" fill="#1e40af">Style tweaks colors after the platform palette is merged in.</text>
++ <text x="278" y="418" text-anchor="middle" font-size="10.5" fill="#1e40af">resolveMask is reset to 0 beforehand so that any user-set brushes always take priority.</text>
++
++ <line x1="278" y1="426" x2="278" y2="446" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- 6 · QPlatformTheme -->
++ <rect x="32" y="448" width="492" height="58" rx="5" fill="#e0f2fe" stroke="#7dd3fc" stroke-width="1.5"/>
++ <text x="278" y="466" text-anchor="middle" font-size="12" font-weight="bold" fill="#0c4a6e">QPlatformTheme::palette() — System Palette</text>
++ <text x="278" y="482" text-anchor="middle" font-size="10.5" fill="#075985">Platform APIs: GetSysColor() on Windows, gtk_style_context_lookup_color() on GTK3, …</text>
++ <text x="278" y="498" text-anchor="middle" font-size="10.5" fill="#075985">Resolved over QStyle::standardPalette(), filling in any roles the style doesn't define.</text>
++
++ <line x1="278" y1="506" x2="278" y2="526" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- 7 · QStyle::standardPalette (lowest priority) -->
++ <rect x="32" y="528" width="492" height="44" rx="5" fill="#f1f5f9" stroke="#cbd5e1" stroke-width="1.5"/>
++ <text x="278" y="546" text-anchor="middle" font-size="12" font-weight="bold" fill="#334155">QStyle::standardPalette() — Base Fallback</text>
++ <text x="278" y="562" text-anchor="middle" font-size="10.5" fill="#475569">Lowest-priority foundation. Used as-is when no platform theme is available.</text>
++
++
++ <!-- ── module labels ── -->
++ <line x1="532" y1="58" x2="532" y2="578" stroke="#e2e8f0" stroke-width="1" stroke-dasharray="4,3"/>
++ <text x="538" y="88" font-size="9.5" fill="#64748b" font-style="italic">QML</text>
++ <text x="538" y="165" font-size="9.5" fill="#64748b" font-style="italic">Qt Quick</text>
++ <text x="538" y="246" font-size="9.5" fill="#94a3b8" font-style="italic">Qt Quick</text>
++ <text x="538" y="257" font-size="9.5" fill="#94a3b8" font-style="italic">Controls</text>
++ <text x="538" y="328" font-size="9.5" fill="#94a3b8" font-style="italic">Qt Gui</text>
++ <text x="538" y="416" font-size="9.5" fill="#94a3b8" font-style="italic">Qt Widgets</text>
++ <text x="538" y="490" font-size="9.5" fill="#94a3b8" font-style="italic">Platform</text>
++ <text x="538" y="553" font-size="9.5" fill="#94a3b8" font-style="italic">Fallback</text>
++
++
++ <!-- ══════════════════════════════════════════════════
++ MATERIAL / UNIVERSAL COLUMN x=570 .. 868
++ ══════════════════════════════════════════════════ -->
++
++ <rect x="570" y="62" width="298" height="30" rx="5 5 0 0" fill="#1e293b"/>
++ <text x="719" y="82" text-anchor="middle" font-size="12" font-weight="bold" fill="#f8fafc">Material &amp; Universal Styles</text>
++ <rect x="570" y="92" width="298" height="18" fill="#334155"/>
++ <text x="719" y="106" text-anchor="middle" font-size="10" fill="#94a3b8">bypass the palette system entirely</text>
++
++ <!-- M/U 1 · Direct binding -->
++ <rect x="570" y="128" width="298" height="44" rx="5" fill="#bbf7d0" stroke="#4ade80" stroke-width="1.5"/>
++ <text x="719" y="147" text-anchor="middle" font-size="12" font-weight="bold" fill="#14532d">Direct color: binding</text>
++ <text x="719" y="163" text-anchor="middle" font-size="10" fill="#166534">Highest priority — same as main path</text>
++
++ <line x1="719" y1="172" x2="719" y2="192" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- M/U 2 · conf / env -->
++ <rect x="570" y="194" width="298" height="60" rx="5" fill="#ede9fe" stroke="#c4b5fd" stroke-width="1.5"/>
++ <text x="719" y="214" text-anchor="middle" font-size="12" font-weight="bold" fill="#4c1d95">qtquickcontrols2.conf</text>
++ <text x="719" y="230" text-anchor="middle" font-size="10" fill="#5b21b6">or style-specific environment variables</text>
++ <text x="719" y="246" text-anchor="middle" font-size="10" fill="#5b21b6">(e.g. QT_QUICK_CONTROLS_MATERIAL_THEME)</text>
++
++ <line x1="719" y1="254" x2="719" y2="274" stroke="#94a3b8" stroke-width="1.5" marker-end="url(#ah)"/>
++
++ <!-- M/U 3 · Hard-coded arrays -->
++ <rect x="570" y="276" width="298" height="68" rx="5" fill="#f1f5f9" stroke="#cbd5e1" stroke-width="1.5"/>
++ <text x="719" y="296" text-anchor="middle" font-size="12" font-weight="bold" fill="#334155">Hard-coded color arrays</text>
++ <text x="719" y="312" text-anchor="middle" font-size="10" fill="#475569">One for light mode, one for dark mode.</text>
++ <text x="719" y="328" text-anchor="middle" font-size="10" fill="#64748b">QQuickMaterialStyle / QQuickUniversalStyle</text>
++ <text x="719" y="343" text-anchor="middle" font-size="10" fill="#94a3b8">Lowest priority in this path.</text>
++
++ <!-- M/U · Propagation note -->
++ <rect x="570" y="360" width="298" height="60" rx="5" fill="#fef9c3" stroke="#fde047" stroke-width="1.5"/>
++ <text x="719" y="379" text-anchor="middle" font-size="11" font-weight="bold" fill="#713f12">QQuickAttachedPropertyPropagator</text>
++ <text x="719" y="395" text-anchor="middle" font-size="10" fill="#92400e">Used instead of the palette tree to propagate</text>
++ <text x="719" y="411" text-anchor="middle" font-size="10" fill="#92400e">style property changes down to child items.</text>
++
++
++ <!-- ══════════════════════════════════════════════════
++ BOTTOM NOTE — QQuickTheme
++ ══════════════════════════════════════════════════ -->
++ <rect x="32" y="592" width="836" height="112" rx="6" fill="#fefce8" stroke="#fde047" stroke-width="1.5"/>
++ <text x="450" y="612" text-anchor="middle" font-size="11.5" font-weight="bold" fill="#713f12">How QQuickTheme fits in (applies to all non-Material / non-Universal styles)</text>
++ <text x="450" y="630" text-anchor="middle" font-size="10.5" fill="#92400e">Qt Quick Controls overrides defaultPalette() on each control type to return QQuickTheme::palette(scope), populated by the style plugin.</text>
++ <text x="450" y="646" text-anchor="middle" font-size="10.5" fill="#92400e">QQuickWindow inherits unset roles from this defaultPalette; child items lazily inherit from their parent's palette up to the window.</text>
++ <text x="450" y="664" text-anchor="middle" font-size="10.5" fill="#92400e">Fusion / macOS — set preferPlatformTheme = true, deferring to the system palette. Imagine / FluentWinUI3 / iOS — supply fully custom palettes.</text>
++ <text x="450" y="682" text-anchor="middle" font-size="10.5" fill="#92400e">Windows — uses QWindowsApplication::populateLightSystemPalette() to pin to light-mode system colors (no dark-mode variant in this style).</text>
++ <text x="450" y="698" text-anchor="middle" font-size="10" fill="#a16207">The Scope argument to QQuickTheme::palette(scope) lets a style supply different palettes for different control types (Button, Window, etc.).</text>
++
++ </svg>