Delete images from automatically scrolling Row in Flickable

Background.qml

import QtQuick
Flickable{
    id:flickable
    anchors.fill:parent
    contentWidth:row.implicitWidth
    interactive:false
    Row{
        id:row
        anchors.fill:parent
    }
    Timer{
        interval:10;
        running:true;
        repeat:true
        onTriggered:{
            if(flickable.atXEnd){
                Qt.createComponent('Pic.qml').createObject(row)
            }
            flickable.contentX++
        }
    }
}

Pic.qml

import QtQuick
Image{
    sourceSize.height:parent.height
    fillMode:Image.PreserveAspectFit
    asynchronous:true
    source:'file://'+RandomImage
}

This continuously scrolls a strip of randomly chosen images from left to right.

This works nicely, but the only problem that remains is that images that scroll offscreen need to be deleted.

What's the best way to achieve this?



Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation