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

Default constructed QPersistentModelIndex is not equal to invalidated QPersistentModelIndex

    XMLWordPrintable

Details

    Description

      Consider the following example:

      QStandardItemModel model(2, 1);
      QPersistentModelIndex index = model.index(1, 0, QModelIndex());
      model.removeRow(1);
      Q_ASSERT(index == QPersistentModelIndex());

      The expected result is that the invalidated QPersistentModelIndex is equal to the default constructed QPersistentModelIndex and that the assertion does not occur.

      The actual result is that the invalidated QPersistentModelIndex is not equal to the default constructed QPersistentModelIndex, and the assertion occurs.

      A default constructed QPersistentModelIndex should be equal to an invalidated QPersistentModelIndex.

      Attachments

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

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            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