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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.0.1
    • Fix Version/s: 5.1.0
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Environment:
      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

            • Assignee:
              stephen.kelly Stephen Kelly (Unused account) (Inactive)
              Reporter:
              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