BusyIndicator's high CPU usage in QtQuick 2

280 Views Asked by At

I use a BusyIndicator as a placeholder for an image until it has been completely downloaded.

BusyIndicator {
    id: bI
    running: img.status !== img.Ready
    anchors.centerIn: parent
    width: 50
    height: 50
}

And here's the Image :

Image {
    id:  img
    visible: true
    source: "https://i.ytimg.com/vi/NeHi1Tg86fE/maxresdefault.jpg"

    onStateChanged: if(img.status === img.Ready){
                        bI.running = false
                    }else{
                        bI.running = true
                    }

But after running the above code I noticed high CPU usage (one full cpu thread) and my entire GPU was also involved before downloading the image completely.

Also another problem is that when the image finishes loading , the busyIndicator is still running.

Any solutions ?

0

There are 0 best solutions below