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

VisualDataModel is not clear about static rootIndex use

XMLWordPrintable

    • 5f7bf058412ff8800f966cbde3dba56cdf99e773

      The documentation for VisualDataModel is not very clear about how to use rootIndex statically.

      In my case, I wanted to expose a QAbstractListModel to QML. This requires that you set rootIndex, but it was not readily apparent how I should do so.

      It seems like I should set it as follows, but I am still not quite sure.

      ListView {
      model: VisualDataModel {
      model: myExposedQAbstractListModel
      rootIndex: modelIndex(0)
      }
      }

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

            dm Geir Vattekar
            larholm Thor Larholm
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes