Fix Windows QML loading, bump to 2.16.2 - #218
Conversation
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>
📝 WalkthroughWalkthroughBumps 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 Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/deploy.yml (1)
277-286: Consider adding verification for critical QML modules.The step uses
-ErrorAction SilentlyContinuewhich 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
QtQuickandQtQmldirectories 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
📒 Files selected for processing (3)
.github/workflows/deploy.ymlCMakeLists.txtsrc/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>
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/deploy.yml
| - 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 |
There was a problem hiding this comment.
🧩 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.ymlRepository: 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.ymlRepository: 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 -20Repository: 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.
|



Summary
Root cause
The ViewCube worked because it only imports
QtQuick(basic rendering). The Inspector and Material List importQtQuick.ControlsandQtQuick.Layouts, which are separate QML modules that must exist on disk. These were bundled for Linux but not Windows.Changes
QDir::listSeparator()forQML2_IMPORT_PATH(;on Windows)Test plan
bin/qml/QtQuick/andbin/qml/QtQml/directories🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
Chores