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

QTreeView::keyboardSearch() doesn't take hidden rows into account

XMLWordPrintable

      Consider a tree with the following items (* means hidden item):

      • Anthony
      • Beatrice
      • Catherine*
      • Camilla
      • Dorothy

      By pressing the sequence "B", "A", "C" the view should scroll from Beatrice to Anthony and then to Camilla.
      Instead Camilla is not selected because QTreeView::keyboardSearch() internally calls d->model->match() to match the next item and
      QAbstractItemModel::match() doesn't care if the current index is visible or hidden in the view and so it matches "Catherine" (first item that started with "C") and returns it.
      QTreeView::keyboardSearch() then takes that matched index, but d->viewIndex() tells it that the matched index is not valid (because it's not visible).
      And thus "Camilla" will never be selected, except if the user types "Cam" fast enough.

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

            monsen Marius Bugge Monsen
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes