Skip to content

QML: fix property name mismatch in ImFileDialog#1505

Merged
tdewey-rpi merged 1 commit into
raspberrypi:mainfrom
wallentx:wallentx/file-dialog-property-name
Feb 10, 2026
Merged

QML: fix property name mismatch in ImFileDialog#1505
tdewey-rpi merged 1 commit into
raspberrypi:mainfrom
wallentx:wallentx/file-dialog-property-name

Conversation

@wallentx

@wallentx wallentx commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Problem: QML-based file dialog fails due to deprecated model role usage

This change addresses issues reported in:

The native XDG Desktop Portal file dialog requires an active user D-Bus session (at least on Arch-based distros). When no session bus is available, rpi-imager correctly falls back to its internal QML-based file picker (ImFileDialog.qml). This fallback path is expected and intentional.

However, the fallback file dialog was entirely non-functional due to incorrect use of a Qt model role. As a result, the file list rendered empty and the application emitted repeated QML errors such as:

NativeFileDialog: No D-Bus session bus available
qml: OSSelectionListView: Restoring scroll - contentY: 0 savedContentY: 138 contentHeight: 999
qml: OSSelectionListView: Restored to 138
qrc:/qt/qml/RpiImager/qmlcomponents/ImFileDialog.qml:670:35: QML Component: Cannot create delegate
qrc:/qt/qml/RpiImager/qmlcomponents/ImFileDialog.qml:673:29: Required property fileURL was not initialized
qrc:/qt/qml/RpiImager/qmlcomponents/ImFileDialog.qml:475:31: QML Component: Cannot create delegate
qrc:/qt/qml/RpiImager/qmlcomponents/ImFileDialog.qml:478:25: Required property fileURL was not initialized

Root cause

The failure was caused by a property name mismatch between the data model and the QML delegates:

Because the property was marked as ``, this mismatch caused delegate instantiation to fail for every item, resulting in the errors shown above and a completely empty file picker.

To be more precise: the fileURL role (uppercase) was actually valid in older Qt versions but has been deprecated since Qt 5.15 and appears to have been removed in Qt 6.10.

* Qt 6.9 Docs: List both fileUrl and fileURL (deprecated).

* Qt 6.10 Docs: List only fileUrl.

This explains why the AppImage (built with Qt 6.9) still works despite using the old name, while native builds on newer systems (like Arch with Qt 6.10) fail completely. My fix updates the code to use the modern, supported fileUrl role, which ensures compatibility with Qt ≥ 5.15 and future Qt versions.

Fix

Renamed all occurrences of fileURL to fileUrl in src/qmlcomponents/ImFileDialog.qml to match the roles provided by FolderListModel.

Verification

Built and tested locally. The internal QML file picker now functions correctly when the native file dialog is unavailable.

Signed-off-by: wallentx <william.allentx@gmail.com>
@lurch

lurch commented Feb 5, 2026

Copy link
Copy Markdown
Collaborator

Interesting... any idea why this only affected the ArchLinux-supplied versions of Raspberry Pi Imager and didn't affect the pre-compiled AppImages that we supply? (see e.g. #1502 (comment) )

@wallentx

wallentx commented Feb 6, 2026

Copy link
Copy Markdown
Contributor Author

There are a few things at play here, so bear with me..

The thing that I'm the most certain of

This is what my PR addresses, and might be best explained by this:
QT 6.9 Docs
QT6.9 Documentation
QT 6.10 (latest) Docs
QT6.10 Documentation

My original PR comment suggesting this being about strictness was incorrect.
In 5.15, they deprecated fileURLin favor of fileUrl.
In 6.10, they removed fileURL.
By convention, the removal of a deprecated feature doesn't get announced when removed, since it is announced at the time of deprecation. It also seems like qmllint would have been silent about this.

I don't have a view of your build system, but I pulled the AppImage from the latest release, and was able to determine that it is running Qt 6.9.3:

$ ./Raspberry_Pi_Imager-v2.0.6-desktop-x86_64.AppImage --appimage-extract
$ strings squashfs-root/usr/lib/libQt6Core.so.6 | grep "Qt 6" | head
Qt 6.9.3 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.4.0)

The Arch repo is currently providing Qt 6.10.2.

The difference in behavior between versions aligns with what they show in their docs.

Things I'm less certain about

I believe prior versions of rpi-imager used udisks2 to allow the application to run as a regular user, but I don’t think that’s the case anymore. Since the GUI now makes calls that require elevated permissions directly, the entire GUI itself needs to be run with sudo, which has implications for D-Bus.

I’m not a D-Bus expert, but the default policy on EndeavourOS and Arch uses auth: EXTERNAL. According to Gemini 3 Pro, this means it “triggers the kernel-level UID check.” I did quite a bit of testing, and neither sudo, sudo -E, nor pkexec was able to access my user’s D-Bus session, which appears to be by design.

As a result, I was unable to get my native build, the Arch repository package, or the AppImage to use my system’s native file picker. All of them fail with No D-Bus session bus available. The application does set XDG* and DBUS_SESSION_BUS_ADDRESS environment variables correctly, but it still fails, so Gemini’s explanation seems plausible to me.

I’d be interested to know whether anyone on another distribution is able to use their system’s native file picker instead of the QML fallback.

@lurch

lurch commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

any idea why this only affected the ArchLinux-supplied versions of Raspberry Pi Imager and didn't affect the pre-compiled AppImages that we supply?

In 5.15, they deprecated fileURLin favor of fileUrl. In 6.10, they removed fileURL. By convention, the removal of a deprecated feature doesn't get announced when removed, since it is announced at the time of deprecation. It also seems like qmllint would have been silent about this.

I don't have a view of your build system, but I pulled the AppImage from the latest release, and was able to determine that it is running Qt 6.9.3:

The Arch repo is currently providing Qt 6.10.2.

Ah excellent! Thank you so much for your digging on this; "In 6.10, they removed fileURL" certainly explains why this only affects the ArchLinux supplied packages.

I'll try to find some time next week to test that AppImages built with your suggested fix included still work okay on Raspberry Pi OS (arm64) and Ubuntu (amd64).

I believe prior versions of rpi-imager used udisks2 to allow the application to run as a regular user, but I don’t think that’s the case anymore.

Correct, there's more info about that in #1336 (comment)

But of course as Raspberry Pi Imager is open-source software, the ArchLinux developers are welcome to maintain a downstream patch that re-enables that functionality in the packages that they provide for their distro.

@tdewey-rpi

Copy link
Copy Markdown
Collaborator

Good catch, @wallentx - thanks for the submission.

As rpi-imager will migrate to 6.10 fairly soon, this is an extremely valuable catch. Critically, it looks safe to use even in our current vendored 6.9 environment.

@tdewey-rpi tdewey-rpi merged commit c73a1b0 into raspberrypi:main Feb 10, 2026
@tdewey-rpi

Copy link
Copy Markdown
Collaborator

believe prior versions of rpi-imager used udisks2 to allow the application to run as a regular user, but I don’t think that’s the case anymore. Since the GUI now makes calls that require elevated permissions directly, the entire GUI itself needs to be run with sudo, which has implications for D-Bus.

That's correct - at least in the current architecture. We observed in internal testing that UDisks2 was completely inoperable in Ubuntu 25.10 - not only did it not prompt, but it threw an auth error back to Imager that presented a UX dead-end. The only viable workaround was to sudo the application - which led to this current architectural workaround.

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.

3 participants