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

QModelIndex::isValid() returns true for non-existing siblings of an index

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.1.0
    • 5.0.1
    • Widgets: Itemviews
    • None
    • WinXp and Win7, Qt5.0.1, msvc2010, QtCreator 2.6.2

    Description

      QModelIndex::isValid() returns true for non-existing siblings of an index, e.g model.index(0,0).sibling(100,100).isValid()

      To reproduce, change this line in of code in spinboxdelegate example:

      tableView.setWindowTitle(QObject::tr("Spin Box Delegate")

      to:

      QString isValidTest = model.index(0,0).sibling(100,100).isValid() ? ":VALID (NOK)" : ":INVALID (OK)";
      tableView.setWindowTitle(QObject::tr("Spin Box Delegate") + isValidTest);

      Qt4.8.3, msvc2008 -> index is invalid (OK)
      Qt5.0.1, msvc2010 -> index is valid (NOK)

      Attachments

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

        Activity

          People

            stephen.kelly Stephen Kelly (Unused account) (Inactive)
            hregelja Hrvoje Regelja
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes