path: root/src/widgets/itemviews/qcolumnview_p.h
diff options
authorGiuseppe D'Angelo <>2015-05-06 14:02:48 +0200
committerGiuseppe D'Angelo <>2015-05-07 22:24:17 +0000
commitea17cc07685575fd1c00c0fc7c4aaa5d87ce72e8 (patch)
tree1687613fc04e9aac244f5eee5e5084dd87fc4af5 /src/widgets/itemviews/qcolumnview_p.h
parente374ffc29c67493a51527117b55a53dfa5dd4267 (diff)
QColumnView: re-enable scrolling of the preview widget
For some reason, each column in a QColumnView is a QAbstractItemView, *including* the preview widget's column. Unfortunately, the preview widget's column class was not overriding scrollContentsBy, so scrolling it had no effect. A more comprehensive solution would be a major refactoring of the code to make that column a plain Q(Abstract)ScrollArea, as it doesn't need QAIV's APIs at all, but I don't want to change code and risk breaking behavior. Change-Id: Ice500a8eaef13c295df4cc274b9f80d9a24c65f4 Task-number: QTBUG-11392 Reviewed-by: Friedemann Kleint <> Reviewed-by: Alexander Volkov <> Reviewed-by: Thorbjørn Lund Martsum <>
Diffstat (limited to 'src/widgets/itemviews/qcolumnview_p.h')
1 files changed, 10 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h
index ed30b5f085..0c0bdb5d1f 100644
--- a/src/widgets/itemviews/qcolumnview_p.h
+++ b/src/widgets/itemviews/qcolumnview_p.h
@@ -89,6 +89,16 @@ public:
+ void scrollContentsBy(int dx, int dy) Q_DECL_OVERRIDE
+ {
+ if (!previewWidget)
+ return;
+ scrollDirtyRegion(dx, dy);
+ viewport()->scroll(dx, dy);
+ QAbstractItemView::scrollContentsBy(dx, dy);
+ }
QRect visualRect(const QModelIndex &) const Q_DECL_OVERRIDE
return QRect();