The current attach implementation does not play nicely with different URLs and only accepts absolute paths without a file scheme. The proposed change allows to use files with the following formats, especially coming from the QML FileDialog component:
The current
attach
implementation does not play nicely with different URLs and only accepts absolute paths without a file scheme. The proposed change allows to use files with the following formats, especially coming from the QML FileDialog component:file:///home/alex/pictures/pic1.png
(Desktops)file:assets-library://asset/asset.JPG%3Fid=&ext=JPG
(iOS image picker)It's still possible to use an absolute or relative path with
Qt.resolvedUrl("../pic1.png")
which is the recommended way of resolving local files.
As mentioned, this change allows easy uploading of images from mobile devices.