Important: Please read the Qt Code of Conduct -

How to load bunch of images to the Image in QML?

  • Hi, I would like to load a few images to the Image object in QML. I want to do it one after another in a loop I think with some delay, because it should pretend to look like an animation. Im new in Qt and QML, so can anybody help? :)

  • Moderators

    You can use Movie element. But it's also possible with Image combined with Timer. A quick example (brain to terminal):
    Image {
    property int picNumber: 0

    id: image
    source: "img" + picNumber + ".png"

    Timer {
    interval: 100
    running: true
    repeat: true

    onTriggered: {

  • Thank you, sierdzio. Now it looks so clear :) I'm not good at timers yet. It works of course, but I've got 36 pictures and they are really big so everything takes too much time. I thought about mix the QML with C++ but I don't know if it would be too difficult for the beginning.

  • Moderators

    If they are big, then you should probably go into converting them into a movie and then playing it back in your app. Video codecs are optimised to handle those situations well, timely and with small CPU/ RAM footprint. QML Image is really meant for displaying static images. My solution above will work, of course, but I would only consider using this approach for some small, corner use cases.

Log in to reply