┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dolphindetailsview.cpp')
-rw-r--r--src/dolphindetailsview.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 1bf5f75e0..53d7fb951 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -1,4 +1,4 @@
-/***************************************************************************
+ /***************************************************************************
* Copyright (C) 2006 by Peter Penz ([email protected]) *
* Copyright (C) 2008 by Simon St. James ([email protected]) *
* *
@@ -171,6 +171,21 @@ QSet<KUrl> DolphinDetailsView::expandedUrls() const
return m_expandedUrls;
}
+QRegion DolphinDetailsView::visualRegionForSelection(const QItemSelection &selection) const
+{
+ // We have to make sure that the visualRect of each model index is inside the region.
+ // QTreeView::visualRegionForSelection does not do it right because it assumes implicitly
+ // that all visualRects have the same width, which is in general not the case here.
+ QRegion selectionRegion;
+ const QModelIndexList indexes = selection.indexes();
+
+ foreach(const QModelIndex& index, indexes) {
+ selectionRegion += visualRect(index);
+ }
+
+ return selectionRegion;
+}
+
bool DolphinDetailsView::event(QEvent* event)
{
if (event->type() == QEvent::Polish) {