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

QAbstractItemModel::multiData SC/BC fallout

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.0.0
    • Fix Version/s: None
    • Component/s: Core: Item Models
    • Labels:
      None

      Description

      In 6.0 QAbstractItemModel::multiData was introduced, and a few overrides provided for models coming with Qt.

      This opens the door to a source incompatibility: in general, if a model overrides data() and multiData(), it should implement data() in terms of multiData(). (The other way around is pointless, as it's the default implementation of multiData). However, a subclass may further override data() to do something else. If that happens, data() and multiData() fall out of sync, and a view gets different results depending on whether it uses data() or multiData().

      Ideally, if one goes the trouble of providing multiData, then it should provide data() as a final override. We can suggest this to users for their models.

      What to do for the models in Qt, however? The major offender is QSIM/QSI, for which multiData overrides have been added, with data() pointing to them. If we want to leave them as-is, we'd need to make multiData() point at data() instead (they won't ever get the benefits of multiData. But after all, theyr'e convenience models)

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              dfaure_kdab David Faure
              Reporter:
              peppe Giuseppe D'Angelo
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes