summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-04-06 14:48:59 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-04-07 08:38:53 (GMT)
commite56af88f159ceee5f9613ab57b2358601e79c081 (patch)
tree9920af48eccfafb9f5b8f3647a1d83c7f5492ab4 /src/gui/itemviews
parent1ba21662a208dc50cd2d7c47fa4cdd3dd07c1617 (diff)
downloadQt-e56af88f159ceee5f9613ab57b2358601e79c081.zip
Qt-e56af88f159ceee5f9613ab57b2358601e79c081.tar.gz
Qt-e56af88f159ceee5f9613ab57b2358601e79c081.tar.bz2
QTreeView: fix PageUp/PageDown with disabled items.
The problem was seen in Qt Creator (in the 'Sources' tab of the debugger). Same logic as in above() and bellow() Reviewed-by: Gabriel
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qtreeview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index d934683..c3ff2bd 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -3194,12 +3194,16 @@ void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninit
int QTreeViewPrivate::pageUp(int i) const
{
int index = itemAtCoordinate(coordinateForItem(i) - viewport->height());
+ while (isItemHiddenOrDisabled(index))
+ index--;
return index == -1 ? 0 : index;
}
int QTreeViewPrivate::pageDown(int i) const
{
int index = itemAtCoordinate(coordinateForItem(i) + viewport->height());
+ while (isItemHiddenOrDisabled(index))
+ index++;
return index == -1 ? viewItems.count() - 1 : index;
}