requestSize in QQuickImageProvider requestImage is always (-1, -1)
Unsolved
QML and Qt Quick
-
Hello,
I'm using a QQuickImageProvider to pass QImages to QML Images, using the requestImage function.
I would like to use the requestedSize parameter to downsize my image if necessary.. but the parameter is always -1, -1.
As I understood from the doc and from this old post, the requestedSize parameter should automatically be set to the sourceSize property of the QML image.. could I rather use the actual displayed size of the image ? And how ?Thanks !
-
@EmilieG I think you want to show picture into a
Image
QML item.
So you have to usesourceSize
, otherwise, the image returned by image provider will be scaled.
For exampleImage { source: "image://myProvider/imagename" sourceSize: Qt.size(width, height) }