summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-03-08 00:48:12 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-04-09 22:38:32 +0200
commitf5dc5225f63d5f99073db9633e0142200cac7810 (patch)
tree77f3345384a94c42fadd41432939c7f5d897fe14 /src/widgets/itemviews
parentb242ab7b10dc99dd3f84dfceac820ed9a8892482 (diff)
When doing a PageDown or PageUp it should show the next set of cells
Before it would skip out a row depending on the size of the tableview. Now it will show the next set of cells for the direction it is going in. Change-Id: I02926d0b2187ffafffb63f7fff43c233b4d7d6af Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r--src/widgets/itemviews/qtableview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 38e4a0bf9b..573df1db6a 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -1755,13 +1755,13 @@ QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifi
visualRow = bottom;
break;
case MovePageUp: {
- int newRow = rowAt(visualRect(current).top() - d->viewport->height());
+ int newRow = rowAt(visualRect(current).bottom() - d->viewport->height());
if (newRow == -1)
newRow = d->logicalRow(0);
return d->model->index(newRow, current.column(), d->root);
}
case MovePageDown: {
- int newRow = rowAt(visualRect(current).bottom() + d->viewport->height());
+ int newRow = rowAt(visualRect(current).top() + d->viewport->height());
if (newRow == -1)
newRow = d->logicalRow(bottom);
return d->model->index(newRow, current.column(), d->root);