QTreeView: fix keyboard navigation when using the right arrow key
The visual column index needs to be replaced by the logical column index in QModelIndex::sibling() call in QTreeView::moveCursor() method. [ChangeLog][QtWidgets][QTreeView] Fixed a key navigation bug when the columns were reordered. Task-number: QTBUG-52793 Change-Id: I4dc89a2705966a94b20edd7f9a4422f089bb670f Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
This commit is contained in:
parent
797cd4b7bc
commit
5d31c9831d
@ -2314,8 +2314,8 @@ QModelIndex QTreeView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifie
|
||||
int visualColumn = d->header->visualIndex(current.column()) + 1;
|
||||
while (visualColumn < d->model->columnCount(current.parent()) && isColumnHidden(d->header->logicalIndex(visualColumn)))
|
||||
visualColumn++;
|
||||
|
||||
QModelIndex next = current.sibling(current.row(), visualColumn);
|
||||
const int newColumn = d->header->logicalIndex(visualColumn);
|
||||
const QModelIndex next = current.sibling(current.row(), newColumn);
|
||||
if (next.isValid())
|
||||
return next;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user