Yes, unfortunately the Image
element is missing an update()
method (to forcibly reset it). Setting the very same source URL will not trigger an update.
You can use something like this as a workaround:
Image {
source: "image://yourImageProvider/something"
cache: false
function reload() {
var oldSource = source;
source = "";
source = oldSource;
}
}
(Or just switch between two URLS, with the same provider name, but different paths...)
You should also push those JPEGs you receive to the QML layer. Once you receive a new image, you should emit a signal from C++'s side from some object exposed to the QML engine, and connect that signal to that reload()
function. The Connections
element will help you there.
Connections {
target: myC++ObjectExposedToTheQMLEngine
onNewFrameReceived: image.reload();
}