Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35502

Delegates complete in reverse order when using asynchronous loaders with GridView/ListView

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.1.0 , 5.2.0 RC1
    • None
    • Windows

    Description

      With the QML code below, in a C++/QML Qt Quick Application, the order in which the loaders finish loading the respective components is reversed.

      I have provided the following:

      1. QML Code.
      2. Console output from running the Qt Quick Application.
      3. File BadCompletionOfLoading.png, showing the result that the user sees as the ListView is populated.
      import QtQuick 2.1
      ListView
      {
          width: 120
          height: 400
       
          // Model to help populate the GridView
          model: 100
       
          delegate: Component
          {
              Loader
              {
                  height: 100
                  width: 150
       
                  asynchronous: true
       
                  sourceComponent: Component
                  {
                      Row
                      {
                          spacing: 10
       
                          Text { text: index }
       
                          Image
                          {
                              height: 100
                              width: 100
                              source: "some_image.png"
                          }
                      }
                  }
                  onStatusChanged: console.log( "Delegate " + index  + ": "
                                               + loaderStateNames[status] );
              }
          }
       
          property var loaderStateNames: [
              "Loader.Null",
              "Loader.Ready",
              "Loader.Loading",
              "Loader.Error"
          ]
      }
      
      Output when using this in a “Qt Quick Application” project (with QML and C++)

      Delegate 0: Loader.Loading
      Delegate 1: Loader.Loading
      Delegate 2: Loader.Loading
      Delegate 3: Loader.Loading
      Delegate 4: Loader.Loading
      Delegate 5: Loader.Loading
      Delegate 6: Loader.Loading
      Delegate 7: Loader.Loading
      Delegate 7: Loader.Ready
      Delegate 6: Loader.Ready
      Delegate 5: Loader.Ready
      Delegate 4: Loader.Ready
      Delegate 3: Loader.Ready
      Delegate 2: Loader.Ready
      Delegate 1: Loader.Ready
      Delegate 0: Loader.Ready

      Interestingly, the result of using this QML code in a "Qt Quick2 UI project" run with QML Scene is quite different and I have described it in http://qt-project.org/forums/viewthread/35722/.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              aalpert Alan Alpert
              balpeck@yahoo.com Balaji Ramachandran
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes