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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.11.0
    • 4.6.1, 5.5.0
    • Widgets: Itemviews
    • None
    • 1382374deaa4a854aeb542e6c8f7e1841f2abb10

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes