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

Strange asymmetry in QAbstractItemView handling of removed rows/columns

XMLWordPrintable

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

      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?

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

            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

              Created:
              Updated:

                There are no open Gerrit changes