From: Peter Penz Date: Thu, 21 Feb 2008 17:34:14 +0000 (+0000) Subject: stay consistent with the QListView behavior: changed the current index also changes... X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/e086d709d83243b31f96b2a68801f73f27885846 stay consistent with the QListView behavior: changed the current index also changes the selection svn path=/trunk/KDE/kdebase/apps/; revision=777817 --- diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index c8c419f02..a725c06f3 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -394,6 +394,12 @@ void DolphinDetailsView::wheelEvent(QWheelEvent* event) QTreeView::wheelEvent(event); } +void DolphinDetailsView::currentChanged(const QModelIndex& current, const QModelIndex& previous) +{ + QTreeView::currentChanged(current, previous); + selectionModel()->select(current, QItemSelectionModel::ClearAndSelect); +} + void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting) { QHeaderView* headerView = header(); diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h index 14e995f6b..295936258 100644 --- a/src/dolphindetailsview.h +++ b/src/dolphindetailsview.h @@ -59,6 +59,7 @@ protected: virtual void keyPressEvent(QKeyEvent* event); virtual void resizeEvent(QResizeEvent* event); virtual void wheelEvent(QWheelEvent* event); + virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous); private slots: /**