Skip to content

Fix Windows QML loading, bump to 2.16.2 - #218

Merged
fernandotonon merged 2 commits into
masterfrom
fix/windows-qml
Mar 25, 2026
Merged

Fix Windows QML loading, bump to 2.16.2#218
fernandotonon merged 2 commits into
masterfrom
fix/windows-qml

Conversation

@fernandotonon

@fernandotonon fernandotonon commented Mar 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fix blank Inspector and broken Material Editor List on Windows
  • Bundle Qt QML modules (QtQuick.Controls, QtQuick.Layouts) in Windows release
  • Fix QML import path separator for Windows (";" vs ":")
  • Bump version to 2.16.2

Root cause

The ViewCube worked because it only imports QtQuick (basic rendering). The Inspector and Material List import QtQuick.Controls and QtQuick.Layouts, which are separate QML modules that must exist on disk. These were bundled for Linux but not Windows.

Changes

  • deploy.yml: Add steps to copy QML modules and runtime DLLs from Qt installation
  • main.cpp: Use QDir::listSeparator() for QML2_IMPORT_PATH (; on Windows)
  • CMakeLists.txt: Version bump 2.16.1 → 2.16.2

Test plan

  • Windows build includes bin/qml/QtQuick/ and bin/qml/QtQml/ directories
  • Inspector panel loads and shows scene tree on Windows
  • Material Editor List modal opens without errors on Windows

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Windows distribution now bundles Qt QML runtime assets and required runtime libraries for QML modules.
  • Bug Fixes

    • QML import path handling updated to use the platform-appropriate path separator for correct cross-platform behavior.
  • Chores

    • Project version advanced to 2.16.2.

Inspector and Material Editor List were blank/broken on Windows
because QtQuick.Controls and QtQuick.Layouts modules weren't
bundled. ViewCube worked because it only uses basic QtQuick.

- Bundle Qt QML modules (QtQuick, QtQml) in bin/qml/ for Windows
- Bundle QML runtime DLLs (QuickControls2, QuickLayouts, etc.)
- Fix QML2_IMPORT_PATH separator: ";" on Windows, ":" on Unix
- Bump version to 2.16.2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Bumps QtMeshEditor version to 2.16.2, adds two Windows PowerShell packaging steps in the build-windows CI job to copy Qt QML modules and runtime DLLs into bin, and replaces a hardcoded ":" with QDir::listSeparator() when assembling QML2_IMPORT_PATH in src/main.cpp.

Changes

Cohort / File(s) Summary
Windows QML Packaging
.github/workflows/deploy.yml
Added two PowerShell steps to build-windows: create bin/qml and recursively copy QtQuick and QtQml module directories from the Qt MinGW install (fail if missing); copy selected Qt6 QML/GL runtime DLLs from $qtDir/bin into bin, logging successful copies.
Version Bump
CMakeLists.txt
Project version changed from 2.16.1 to 2.16.2, updating ${PROJECT_VERSION} / QTMESHEDITOR_VERSION_STRING and related -D defines.
Cross-Platform QML Paths
src/main.cpp
Imported <QDir> and replaced hardcoded ":" with QDir::listSeparator() when joining qmlImportPaths and when concatenating with any existing QML2_IMPORT_PATH.

Sequence Diagram(s)

sequenceDiagram
    participant Actions as GitHub Actions Runner
    participant PS as PowerShell step
    participant Qt as Qt MinGW install (qtDir)
    participant FS as Workspace `bin` directory

    Note over Actions,PS: build-windows job runs
    Actions->>PS: execute packaging script
    PS->>Qt: read modules at `$qtDir/qml/QtQuick`, `$qtDir/qml/QtQml`
    alt modules exist
        PS->>FS: create `bin/qml` and copy module dirs
        PS->>FS: copy matching DLLs from `$qtDir/bin` into `bin`
        PS->>Actions: log copied directories and DLLs
    else missing modules
        PS->>Actions: emit error and fail step
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through versions, dot-one to dot-two,

bundled QML treasures and DLLs too,
separators now listen to each platform's call,
bin fills with runtime, no modules shall fall. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: fixing Windows QML loading and bumping version to 2.16.2, matching the core changes in the changeset.
Description check ✅ Passed The description covers all required template sections with comprehensive details: Summary lists the fixes and version bump, and Technical Details explains root cause, changes to each file, and test plan.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/windows-qml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/deploy.yml (1)

277-286: Consider adding verification for critical QML modules.

The step uses -ErrorAction SilentlyContinue which silently ignores copy failures. If the Qt installation path changes or modules are missing, the build will succeed but the Inspector/Material Editor will fail at runtime on Windows.

Consider adding a verification step to ensure at least QtQuick and QtQml directories exist after copying:

💡 Suggested verification
       Copy-Item -Recurse "$qtDir/qml/QtQuick" "$qmlDest/" -ErrorAction SilentlyContinue
       Copy-Item -Recurse "$qtDir/qml/QtQml" "$qmlDest/" -ErrorAction SilentlyContinue
       Write-Host "QML modules copied to $qmlDest"
       Get-ChildItem $qmlDest -Directory
+      # Verify critical modules were copied
+      if (-not (Test-Path "$qmlDest/QtQuick")) {
+          Write-Error "Critical: QtQuick module not found after copy"
+          exit 1
+      }
+      if (-not (Test-Path "$qmlDest/QtQml")) {
+          Write-Error "Critical: QtQml module not found after copy"
+          exit 1
+      }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy.yml around lines 277 - 286, The current PowerShell
copy step uses Copy-Item with -ErrorAction SilentlyContinue (lines referencing
$qtDir, $qmlDest, and the Copy-Item calls for "QtQuick" and "QtQml") which can
hide failures; add an explicit verification after the copy to Test-Path (or
Get-ChildItem) that "$qmlDest/QtQuick" and "$qmlDest/QtQml" exist and if not
call Write-Error and exit 1 to fail the job (or remove SilentlyContinue and let
errors bubble), so the workflow fails early when critical QML modules are
missing.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/deploy.yml:
- Around line 277-286: The current PowerShell copy step uses Copy-Item with
-ErrorAction SilentlyContinue (lines referencing $qtDir, $qmlDest, and the
Copy-Item calls for "QtQuick" and "QtQml") which can hide failures; add an
explicit verification after the copy to Test-Path (or Get-ChildItem) that
"$qmlDest/QtQuick" and "$qmlDest/QtQml" exist and if not call Write-Error and
exit 1 to fail the job (or remove SilentlyContinue and let errors bubble), so
the workflow fails early when critical QML modules are missing.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8ceb84fa-5e78-4261-a900-a99869f25d0e

📥 Commits

Reviewing files that changed from the base of the PR and between 3243e7d and e6100c2.

📒 Files selected for processing (3)
  • .github/workflows/deploy.yml
  • CMakeLists.txt
  • src/main.cpp

Fail the build early if QtQuick or QtQml modules weren't copied,
rather than silently producing a broken Windows release.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/deploy.yml:
- Around line 297-311: Update the "Copy Qt QML runtime libraries" PowerShell
step to include the six missing core QML DLL names (Qt6Quick, Qt6Qml,
Qt6QmlModels, Qt6QmlMeta, Qt6QmlWorkerScript, Qt6QmlCore) in the foreach $lib
list (alongside the existing entries) and add a verification after the loop that
compares the number of DLLs successfully copied to the expected total (use a
counter incremented when Copy-Item succeeds, referencing $qtDir/$dest and the
foreach loop variables) and fail the job or Write-Error if the counts do not
match to prevent silent misses.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4292084c-bc25-493e-9a3a-e800fd170e25

📥 Commits

Reviewing files that changed from the base of the PR and between e6100c2 and 42ab36e.

📒 Files selected for processing (1)
  • .github/workflows/deploy.yml

Comment on lines +297 to +311
- name: Copy Qt QML runtime libraries
run: |
$qtDir = "D:/a/QtMeshEditor/Qt/${{ env.QT_VERSION }}/mingw_64"
$dest = "${{github.workspace}}/bin"
foreach ($lib in @("Qt6QuickControls2", "Qt6QuickControls2Impl", "Qt6QuickControls2Basic",
"Qt6QuickControls2BasicStyleImpl", "Qt6QuickTemplates2", "Qt6QuickLayouts",
"Qt6QuickDialogs2", "Qt6QuickDialogs2Utils", "Qt6QuickDialogs2QuickImpl",
"Qt6OpenGL")) {
$dll = "$qtDir/bin/${lib}.dll"
if (Test-Path $dll) {
Copy-Item $dll $dest
Write-Host "Copied $lib.dll"
}
}
shell: powershell

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for other steps that might copy Qt6Qml.dll and Qt6Quick.dll to bin/
rg -n "Qt6Qml|Qt6Quick" .github/workflows/deploy.yml | grep -i "copy\|dll"

Repository: fernandotonon/QtMeshEditor

Length of output: 52


🏁 Script executed:

sed -n '623,628p' .github/workflows/deploy.yml

Repository: fernandotonon/QtMeshEditor

Length of output: 521


🏁 Script executed:

# Check the full context around the Windows copy step and Linux equivalent
sed -n '287,311p' .github/workflows/deploy.yml

Repository: fernandotonon/QtMeshEditor

Length of output: 1197


🏁 Script executed:

# Search for any other copy operations involving the core QML DLLs
rg -n "Copy-Item|copy" .github/workflows/deploy.yml | head -20

Repository: fernandotonon/QtMeshEditor

Length of output: 1875


Add missing core QML DLLs and verification check.

The DLL list is incomplete compared to the Linux build. The Windows step copies only 10 libraries while Linux copies 15, missing these core QML libraries: Qt6Quick, Qt6Qml, Qt6QmlModels, Qt6QmlMeta, Qt6QmlWorkerScript, Qt6QmlCore.

Additionally, while the QML modules step above (lines 282-294) includes verification that critical modules were copied, this DLL copy step has no safeguard—if the Qt installation layout differs, DLLs could silently fail to copy without detection.

Suggested fix: Add the 6 missing libraries to the list and include a verification count to catch silent failures.

Example improvement
     - name: Copy Qt QML runtime libraries
       run: |
             $qtDir = "D:/a/QtMeshEditor/Qt/${{ env.QT_VERSION }}/mingw_64"
             $dest = "${{github.workspace}}/bin"
+            $copiedCount = 0
             foreach ($lib in @("Qt6QuickControls2", "Qt6QuickControls2Impl", "Qt6QuickControls2Basic",
                                "Qt6QuickControls2BasicStyleImpl", "Qt6QuickTemplates2", "Qt6QuickLayouts",
                                "Qt6QuickDialogs2", "Qt6QuickDialogs2Utils", "Qt6QuickDialogs2QuickImpl",
-                               "Qt6OpenGL")) {
+                               "Qt6OpenGL", "Qt6Quick", "Qt6Qml", "Qt6QmlModels", "Qt6QmlMeta",
+                               "Qt6QmlWorkerScript", "Qt6QmlCore")) {
                 $dll = "$qtDir/bin/${lib}.dll"
                 if (Test-Path $dll) {
                     Copy-Item $dll $dest
                     Write-Host "Copied $lib.dll"
+                    $copiedCount++
                 }
             }
+            if ($copiedCount -eq 0) {
+                Write-Error "Critical: No QML runtime DLLs were copied"
+                exit 1
+            }
       shell: powershell
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/deploy.yml around lines 297 - 311, Update the "Copy Qt QML
runtime libraries" PowerShell step to include the six missing core QML DLL names
(Qt6Quick, Qt6Qml, Qt6QmlModels, Qt6QmlMeta, Qt6QmlWorkerScript, Qt6QmlCore) in
the foreach $lib list (alongside the existing entries) and add a verification
after the loop that compares the number of DLLs successfully copied to the
expected total (use a counter incremented when Copy-Item succeeds, referencing
$qtDir/$dest and the foreach loop variables) and fail the job or Write-Error if
the counts do not match to prevent silent misses.

@sonarqubecloud

Copy link
Copy Markdown

@fernandotonon
fernandotonon merged commit 66bbdbc into master Mar 25, 2026
18 checks passed
@fernandotonon
fernandotonon deleted the fix/windows-qml branch March 25, 2026 03:32
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