stay consistent with the QListView behavior: changed the current index also changes the selection

svn path=/trunk/KDE/kdebase/apps/; revision=777817
This commit is contained in:
Peter Penz 2008-02-21 17:34:14 +00:00
parent 518372394d
commit e086d709d8
2 changed files with 7 additions and 0 deletions

View file

@ -394,6 +394,12 @@ void DolphinDetailsView::wheelEvent(QWheelEvent* event)
QTreeView::wheelEvent(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) void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting)
{ {
QHeaderView* headerView = header(); QHeaderView* headerView = header();

View file

@ -59,6 +59,7 @@ protected:
virtual void keyPressEvent(QKeyEvent* event); virtual void keyPressEvent(QKeyEvent* event);
virtual void resizeEvent(QResizeEvent* event); virtual void resizeEvent(QResizeEvent* event);
virtual void wheelEvent(QWheelEvent* event); virtual void wheelEvent(QWheelEvent* event);
virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous);
private slots: private slots:
/** /**