diff options
author | Kaligin Sergey <kaligin-sergey@yandex.ru> | 2016-05-11 14:46:47 +0300 |
---|---|---|
committer | Thorbjørn Lund Martsum <tmartsum@gmail.com> | 2016-06-16 15:19:45 +0000 |
commit | 5d31c9831da42ffb5f720b147d99be6d9eb93e30 (patch) | |
tree | 7a559d6cc93f2bcfb055ffb04df58d80a185464d /src/widgets/itemviews/qtreeview.cpp | |
parent | 797cd4b7bc8e9864c2d569c110b61e49e15c80c2 (diff) |
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>
Diffstat (limited to 'src/widgets/itemviews/qtreeview.cpp')
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 135c417f15..01ebae0848 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -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; } |