Solved Database BLOB to Image in Qml
-
So I have an SQL Database which contains an Picture stored as a BLOB.
What is the easiest way to show it in an Image in QML ?
I already can expose the data to QML as QByteArray but how to load that in an Image?
-
You can try the technique described here.
-
Hi,
What about a custom image provider ?
-
@SGaist Can I provide to that one If I get the data in QML as QByteArray? I expose a struct with other data aswell to QML and one contains the QByteArray.
-
You can try the technique described here.
-
I followed the instructions in the link you provided and it worked well.
I just don't understand how you would came up with passing
"data:image/png;base64,"
to Image. I think that should be in the docs of Image.
-
That is the way to fully embed an image in a web page without the need for a remote file but it makes the size of the data at least twice as big.