Important: Please read the Qt Code of Conduct -

Loading Image in DocumentGalleryModel takes extremely long time

  • Hi Guys,

    I am trying to use the "QML DocumentGalleryModel": with the following code (on my Symbian N8 device):
    @importQt 4.7
    import 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" ]
            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,

    [edit: fixed typo in title, Eddy]

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

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

  • 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.

  • 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!

Log in to reply