[Interest] Qt iOS - HowTo get access to Images stored at device

ekke ekke at ekkes-corner.org
Wed Oct 25 23:14:50 CEST 2017


Am 25.10.17 um 21:56 schrieb Thiago Macieira:
> On Wednesday, 25 October 2017 10:42:51 PDT ekke wrote:
>> QFileInfo then gives me this as filename:
>> "asset.PNG?id=E8CE839A-29EA-42B2-A8FD-89B57ABEC765&ext=PNG"
>> and this as path:
>> "assets-library://asset/asset.PNG?id=E8CE839A-29EA-42B2-A8FD-89B57ABEC765&ex
>> t=PNG" I'm also getting the correct size of the Images from QFileInfo
>>
>> But I couldn't figure out HowTo get the local FileName and Path
> Why do you want to? It looks like QFile and QFileInfo are operating properly 
> and you can open the file.
>
You're right - must be blind - Got the QFileInfo and of course then
QFile also can open and read the file

now only one problem left: HowTo display this file as Image in QML ?

this normaly works to display the Image using the filePath from QFileInfo:

Image{

id:theImage

anchors.fill:parent

source:"file://"+currentFile.path

fillMode:Image.PreserveAspectFit

}

for Photos from assets-library I'm getting QML Image: Cannot open:
file://assets-library//asset/asset.PNG?id=32E17445-91B9-48FE-81C6-13D4E2F01554&ext=PNG

tried without "file://" - then getting

QML Image: Protocol "assets-library" is unknown

do you have an idea How the URL must be constructed for Image source ?

thx

ekke

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20171025/b50109d6/attachment.html>


More information about the Interest mailing list