┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-12-15 16:25:23 +0000
committerPeter Penz <[email protected]>2007-12-15 16:25:23 +0000
commitecce6e87f8540aa690a2098d89e22b4ab85e325f (patch)
tree9d9d9519ff8f0152e4a6c48e7290b961dfaca331 /src
parente91a20c9b8faabde14a04f2d30c7a9229a33adc6 (diff)
fixed selection behavior in the details view (when the selection enters the viewport area, Qt's QTreeView does no selection at all, even if the items are still within the elastic band)
svn path=/trunk/KDE/kdebase/apps/; revision=748819
Diffstat (limited to 'src')
-rw-r--r--src/dolphindetailsview.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp
index 68b288b0b..d90527767 100644
--- a/src/dolphindetailsview.cpp
+++ b/src/dolphindetailsview.cpp
@@ -199,9 +199,24 @@ void DolphinDetailsView::mousePressEvent(QMouseEvent* event)
void DolphinDetailsView::mouseMoveEvent(QMouseEvent* event)
{
- QTreeView::mouseMoveEvent(event);
if (m_showElasticBand) {
+ const QPoint mousePos = event->pos();
+ const QModelIndex index = indexAt(mousePos);
+ if (!index.isValid()) {
+ // the destination of the selection rectangle is above the viewport. In this
+ // case QTreeView does no selection at all, which is not the wanted behavior
+ // in Dolphin -> select all items within the elastic band rectangle
+ clearSelection();
+ if (mousePos.x() < header()->sectionSize(DolphinModel::Name)) {
+ setSelection(QRect(m_elasticBandOrigin, m_elasticBandDestination),
+ QItemSelectionModel::Select);
+ }
+ }
+
+ QTreeView::mouseMoveEvent(event);
updateElasticBand();
+ } else {
+ QTreeView::mouseMoveEvent(event);
}
}