qt5base-lts/tests/auto/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
..
qabstractitemview Stabilize tst_QAbstractItemView::task250754_fontChange(). 2014-04-30 16:53:55 +02:00
qcolumnview Do not run tst_qcolumnview in parallel 2014-03-19 19:51:20 +01:00
qdatawidgetmapper QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
qdirmodel QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
qfileiconprovider QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
qheaderview QNX: Fix QHeaderView autotest 2014-04-09 20:53:06 +02:00
qitemdelegate WinRT: Fix various test compilations 2013-10-02 12:36:05 +02:00
qitemeditorfactory QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
qitemview QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
qlistview BlackBerry: Fix QListView autotest 2014-04-04 19:32:21 +02:00
qlistwidget Fix tst_QListWidget::task217070_scrollbarsAdjusted() 2014-04-09 20:53:06 +02:00
qtableview Fix key navigation through cells with spans in QTableView. 2014-06-06 15:50:58 +02:00
qtablewidget QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
qtreeview Fix visual index lookup in QTreeViewPrivate::adjustViewOptionsForIndex(). 2014-05-06 16:35:56 +02:00
qtreewidget Fix QTreeWidget autotest 2014-04-04 19:32:21 +02:00
qtreewidgetitemiterator QtWidgets tests: Remove DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 2013-03-28 02:02:14 +01:00
itemviews.pro Move QStandardItem/QStandardItemModel to QtGui 2012-06-29 22:42:19 +02:00