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. Loading Image in DocumentGalleryModel takes extremely long time
Forum Updated to NodeBB v4.3 + New Features

Loading Image in DocumentGalleryModel takes extremely long time

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 4 Posters 2.6k Views 1 Watching
  • 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.
  • W Offline
    W Offline
    wladek
    wrote on last edited by
    #1

    Hi Guys,

    I am trying to use the "QML DocumentGalleryModel":http://doc.qt.nokia.com/qtmobility-1.1.1/qml-documentgallerymodel.html with the following code (on my Symbian N8 device):
    @importQt 4.7
    import QtMobility.gallery 1.1

    Rectangle {
    width: 600
    height: 360
    color: "lightblue"

    GridView {
        id: gridView
        anchors.fill: parent
        cellWidth: 128
        cellHeight: 128
    
        model: DocumentGalleryModel {
            rootType: DocumentGallery.Image
            properties: [ "url" ]
        }
    
        delegate:
            Item {
                Image {
                    id: imageBusy
                    source: "busy.png"
                    width: 110
                    height: 110
                    sourceSize.width: 110
                    sourceSize.height: 110
                    visible: imageDelegate.status != Image.Ready
                }
                Image {
                    id: imageDelegate
                    asynchronous: true
                    source: url
                    smooth: true
                    width: 110
                    height: 110
                    fillMode: Image.PreserveAspectFit
                    sourceSize.width: 110
                    sourceSize.height: 110
                    onStatusChanged: {
                        console.log("Status is: " + status);
                    }
                }
        }
    }
    

    }@

    The problem is that displaying the images takes super long time (for just 20 images it takes around 10 seconds).

    Any ideas on how can I improve this time?

    I also know that drawing the image is problematic, hence retrieving the data from the model goes straight forward. It's also true that the images have a big resolution (aprox. 4000 x 2000).

    Any leads are highly appreciated.

    Thanks in advance and regards,
    Wladek

    [edit: fixed typo in title, Eddy]

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Well, those images are rather big. Does it help to disable smooth?

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wladek
        wrote on last edited by
        #3

        No noo....I already tried this. No improvement at all.

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pdrummond
          wrote on last edited by
          #4

          I've had the same problem except I couldn't get photo's taken from a C7 to display at all because of their size. All I got was the following error:

          @QVGImagePool: cannot reclaim sufficient space for a 3264x1832 image@

          To get around this problem it is possible to scale the image down by setting the Image.sourceSize to a lower size than the actual image.

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            QtRoS
            wrote on last edited by
            #5

            First of all, set asynchronous property of Image in delegate to true. Then use sourceSize property to set optimal size of image. Result - Image of this size will be loaded in memory asynchronously! So UI will not be blocked!

            1 Reply Last reply
            0

            • Login

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