Failed to get image from provider
-
You mean you want to take the jpg from one location and save it in another? Use QFile::copy().
-
@gabor53
Hi
Ok, but are you sure the QQuickImageProvider should be involved in the
saving of the image?
The syntax "image://pix/" seems for loading only, docs mention nothing about saving.
Anyway, i was just wondering.@mrjj,
The goal is to save the actual jpg into Qt Quick Local Storage. To do that I need to create a Blob from the jpg file. I don't think it is possible to do in QML; that's why I use QQuickImageProvider to send the image from QML to C++ and return a pixmap to QML.
If I copy 1.jpg to the qml folder and pass1.jpg to QQuickImageProvider the image is correctly displayed, which means the path I get from fileDialog.fileUrl is incorrect.
How can I fix the path so fileDialog.fileUrl provides the right path to the image?
Thank you. -
hi
so you get a pixmap back to QML but how do you then convert it to the blob?
As far as i understand, Qt Quick Local Storage is a sqllite database so
you need it as QbyteArray to save it. -
hi
so you get a pixmap back to QML but how do you then convert it to the blob?
As far as i understand, Qt Quick Local Storage is a sqllite database so
you need it as QbyteArray to save it. -
Did you already check Qt Quick Local Storage QML Types ?
By the way, why do you want to store images there ?
-
Did you already check Qt Quick Local Storage QML Types ?
By the way, why do you want to store images there ?
@SGaist ,
I checked Local Storage QML Types but it doesn't really talk about images.
I'm creating a small app where I can store an image and a description of the image. I used to do it by storing only the url, but eventually the images got moved and I ended up with a bunch of broken links. -
In that case, I would rather go with a more classical approach through C++ especially if you want to recover the images.
-
In that case, I would rather go with a more classical approach through C++ especially if you want to recover the images.