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

QAbstractItemModel: Emit index and item based data change signals whenever data in a model changes

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • P4: Low
    • 5.0.0
    • None
    • Widgets: Itemviews
    • None

    Description

      QAbstractItemModel emits the dataChanged() signal whenever data in an existing index changes. However, the signal may provide information about multiple indexes, and does not provide information about which role the data in the index changed for or what the new data is (or what the previous data was).

      Thus, it would be nice if models emitted a signal whenever the data in an existing index changes, that contains information about the index, the role, the new data, and possibly the previous data. Something like the following:

      void indexDataChanged(const QModelIndex &index, int role, const QVariant &new, const QVariant &old);

      It would be nice if corresponding item based signals were emitted by the convenience views (QListWidget, QTableWidget and QTreeWidget). Something like:

      void itemDataChanged(QListWidgetItem *item, int role, const QVariant &new, const QVariant &old);
      void itemDataChanged(QTableWidgetItem *item, int role, const QVariant &new, const QVariant &old);
      void itemDataChanged(QTreeWidgetItem *item, int column, int role, const QVariant &new, const QVariant &old);

      Attachments

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

        Activity

          People

            waterdomain Water Domain (Inactive)
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes