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

QStandardItem is using un-documented value of Qt::ItemDataRole

    XMLWordPrintable

Details

    • 85eebedb1 (dev), 49bd0a819 (6.6), c3bcea31e (tqtc/lts-6.5)

    Description

      QStandardItem is using data()/setData() with un-documented value `255` of Qt::ItemDataRole for its methods such as flags()/setFlags() and isEditable()/setEditable().

      When users subclass from QStardardItem and override data() and/or setData(), those methods become unavailable if they don't call QStandardItem::data()/setData() for these un-documented values, as most the examples on Qt's docs website do, e.g. https://doc.qt.io/qt-6/model-view-programming.html .

      PLEASE metion this behavior on QStandardItem's docs page, especially for data()/setData()/flags()/setFlags() and getter/setter for individual flag such as isEditable()/setEditable().

      This is infact an old issue reported in 2012: https://bugreports.qt.io/browse/QTBUG-25224 , which was closed as unresolved.

      Attachments

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

        Activity

          People

            ahmad.samir Ahmad Samir
            namniav vainman H
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: