qt5base-lts/tests/manual/widgets/itemviews
Mitch Curtis a18e3a3cef Fix key navigation through cells with spans in QTableView.
When navigating with the directional keys or tab/backtab, there are
certain situations where the cell that is edited is incorrect.
For example, consider the table below.

 '^' represents the starting cell and the direction of navigation.
 'c' represents the index that is arrived at as the currentIndex prior to this patch as
reported by view.selectionModel()->currentIndex().
 'x' is the cell that should be edited:

+---+---+---+---+
|   |   | e |   |
+---+---+---+---+
|   | x     |   |
+---+       +---+
|   |     c |   |
+---+---+---+---+
|   |   | ^ |   |
+---+---+---+---+

Before this patch, the cell that will actually be edited is c, rather
than x, so after editing the cell and pressing enter, the previous
contents of the cell will still be shown.

With this patch, currentIndex() will be changed after every call to
cursorMove(). Navigation into and out of cells is not affected because
the visualCursor member in the QTableViewPrivate tracks the keyboard
navigation entry point. If after the up navigation into the span, the
user presses up, the cell entered is 'e', not the cell above 'x'.

Task-number: QTBUG-29239

[ChangeLog][QtWidgets][QTableView][QTableWidget] currentIndex() now
reflects the top left cell when in a span.

Change-Id: I3dc3db46ebba340102860fc4ad98fcaf91484983
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2014-06-06 15:50:58 +02:00
..
autoResizePrecision QHeaderView - remove confusing bool 2013-11-08 22:17:03 +01:00
delegate QComboBox - only react on a mouse-release if we had a mousepress 2013-08-21 21:08:08 +02:00
qheaderview Fixup compilation of the manual tests 2014-03-22 19:54:27 +01:00
qtreeview Fixup compilation of the manual tests 2014-03-22 19:54:27 +01:00
qtreewidget Fixup compilation of the manual tests 2014-03-22 19:54:27 +01:00
tableview-span-navigation Fix key navigation through cells with spans in QTableView. 2014-06-06 15:50:58 +02:00
itemviews.pro Fix key navigation through cells with spans in QTableView. 2014-06-06 15:50:58 +02:00