summaryrefslogtreecommitdiffstats
path: root/tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@digia.com>2014-06-04 14:39:49 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-06-06 15:50:58 +0200
commita18e3a3ceff970250498b38ec85ae43c67b7993f (patch)
tree15511aa252134e665b459168da97532cae33f7b4 /tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro
parent5395180fcb9a68b1590ce4bf29ef26745161403f (diff)
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>
Diffstat (limited to 'tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro')
-rw-r--r--tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro b/tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro
new file mode 100644
index 0000000000..ffa006a2d8
--- /dev/null
+++ b/tests/manual/widgets/itemviews/tableview-span-navigation/tableview-span-navigation.pro
@@ -0,0 +1,8 @@
+
+TEMPLATE = app
+TARGET = tableview-span-navigation
+INCLUDEPATH += .
+
+QT += widgets
+
+SOURCES += main.cpp