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

Strange asymmetry in QAbstractItemView handling of removed rows/columns

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • None
    • Widgets: Itemviews
    • None

    Description

      When fixing a bug in QAIV, I've spotted a strange asymmetry: QAbstractItemView::rowsAboutToBeRemoved has

          // Ensure one selected item in single selection mode.
          QModelIndex current = currentIndex();
          if (d->selectionMode == SingleSelection
              && current.isValid()
              && current.row() >= start
              && current.row() <= end
              && current.parent() == parent) { // <- 
      

      while QAbstractItemViewPrivate::_q_columnsAboutToBeRemoved has

          // Ensure one selected item in single selection mode.
          QModelIndex current = q->currentIndex();
          if (current.isValid()
              && selectionMode == QAbstractItemView::SingleSelection
              && current.column() >= start
              && current.column() <= end) {
      

      Why isn't this checking that the current index's parent is the same under which columns are being removed? Is there some subtlety going on that likely deserves some comments in the code?

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            peppe Giuseppe D'Angelo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes