Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 5.8 QML Image async long delay
QtWS25 Last Chance

Qt 5.8 QML Image async long delay

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 1.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    franzi
    wrote on last edited by franzi
    #1

    Hi,

    after I updated Qt 5.7 to Qt 5.8, I noticed loading of images over HTTP became very slow. I'm running the application on RPi, but the same thing happens on Linux Ubuntu. Reverting to Qt 5.7 the problem is solved. Consider this QML snippet:

    main.qml

    import QtQuick 2.0
    import QtQuick.Controls 1.0
    
    ApplicationWindow {
        visible: true
        width: 1350
        height: 800
        title: qsTr("Qt Quick Controls 1.0")
    
        GridView {
            id: grid
            width: parent.width
            height: cellHeight
    
            cellWidth: 225
            cellHeight: 320
    
            focus: true
    
            model: 20
            delegate: Card {
                pic: (index > 5) ? "http://www.planwallpaper.com/static/images/nasas-images-of-most-remarkable-events-you-cant-miss.jpg" : "https://d36tnp772eyphs.cloudfront.net/blogs/1/2015/04/lion-photo.jpg"
    
            }
    
            Keys.onReturnPressed: time.running = false;
        }
    
        Timer {
            id: time
            interval: 1
            running: true
            repeat: true
            property double count: 0.0
            property double time0: 0.0
            onTriggered: {
                if(time0 == 0.0) time0 = Date.now();
                txt.text = "elapsed time (ms): " + (Date.now() - time0);
                for(grid.currentIndex = 0; grid.currentIndex < 20; grid.currentIndex++)
                        count += grid.currentItem.load;
                if(count == 20.0)
                    time.running = false;
                else count = 0.0
            }
        }
    
        Text {
            id: txt
            anchors.bottom: parent.bottom
            anchors.right: parent.right
            font.pixelSize: 30
        }
    }
    

    Card.qml

    import QtQuick 2.0
    
    Item {
        id: cardItem
        width: 235
        height: 320
        property string pic
        property double load: cardImage.progress
    
        Image {
            id: cardImage
            anchors.fill: cardItem
            source: pic
        }
    }
    

    What I noticed too, if I set asynchronous: true on images loaded over qrc, the same thing happens - those have a big delay too. My first guess is that something has changed in how Qt handles async image loading, but I can't find anything in the changelogs.

    Any help is appreciated. Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Looks like a regression. You should take a look at the bug report system to see if it's something known. If not please consider opening a new report providing a minimal compilable example.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved