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

QML ListView ignores modelReset signal

    XMLWordPrintable

Details

    • 950f384

    Description

      QML List view seems not to handle the modelReset signal from its model.

      The video shows the issue. On the left is a QListView, and on the right the qml view. The model is fed a command to reset and emits the correct signals. The QListView responds, but the qml view does not. Items are only repainted when they leave and re-enter the view.

      QListView *listView = new QListView();
      listView->setModel(rootModel);
      listView->show();

      QmlView *view = new QmlView();
      view->setUrl(QUrl( "/path/to/qmlfile.qml" ) );
      view->engine()>rootContext()>setContextProperty( "events_model", QVariant::fromValue( static_cast<QObject*>( rootModel ) ) );
      view->execute();
      view->show();

      import Qt 4.6

      Rectangle {
      width: 490; height: 400;

      ListView {
      model : events_model
      anchors.fill: parent
      delegate : Component
      {
      Item {
      height : 15
      Text

      { text: model.display }

      }
      }
      }
      }

      Attachments

        1. qmlview-nohandle-reset.ogv
          735 kB
          Stephen Kelly (Personal)
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes