I am have a QImage object in my Qt app on the C++ side of code.
Image {
id: my_image
source: ""
}
I have the QML Connections element in which I am getting a QImage sent
Connections {
target: qimage_supplier
onNewQImage: {
recalled_media_image.source = new_qimage_supplied
}
}
Question:
Is it possible to set a QImage object to the source of a Image QML item?
Doing above way where new_qimage_supplied is actually a QImage sent from C++ side, it complains the following:
Error: Cannot assign QImage to QUrl
How can I set a QImage object to Image QML element?
image.pngin the example wheresourceis set to theimageproviderasimage://MyImageProvider/Image.png. the full declaration is like this.Image { source: "image://MyImageProvider/Image.png" }void SetImage(QImage image)in myQQuickImageProviderderived class which I call from CPP side to set an image whenever available from some processing.QImageobject on to theImageQML item from C++ side whenever I get a newQImage. thats it.QQuickImageProviderderived class way is nice but how to trigger/manually initiate a call torequestImage?