diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-05-06 14:02:48 +0200 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2015-05-07 22:24:17 +0000 |
commit | ea17cc07685575fd1c00c0fc7c4aaa5d87ce72e8 (patch) | |
tree | 1687613fc04e9aac244f5eee5e5084dd87fc4af5 /src/widgets/itemviews | |
parent | e374ffc29c67493a51527117b55a53dfa5dd4267 (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 <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Alexander Volkov <a.volkov@rusbitech.ru>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qcolumnview_p.h | 10 |
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: QAbstractScrollArea::resizeEvent(event); } + 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(); |