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

Behaviour of QStandardItem::setItemData() is inconsistent with QAbstractItemModel::setItemData()

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 4.6.1, 5.5.0
    • Fix Version/s: 5.11.0
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Commits:
      1382374deaa4a854aeb542e6c8f7e1841f2abb10

      Description

      Documentation for QAbstractItemModel::setItemData() states:

      Roles that are not in roles will not be modified.

      However, QStandardItemModel's reimplementation uses QStandardItem::setItemData(), which replaces the existing values with the new values:

      if (values!=newValues)

      { values=newValues; if (model) model->d_func()->itemChanged(q); }

      So the behaviour is inconsistent.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-10872
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              sgaist Samuel Gaist
              Reporter:
              swongu s
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes