diff options
Diffstat (limited to 'src/dolphindetailsview.cpp')
| -rw-r--r-- | src/dolphindetailsview.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dolphindetailsview.cpp b/src/dolphindetailsview.cpp index 1aec30cca..dfd7018bb 100644 --- a/src/dolphindetailsview.cpp +++ b/src/dolphindetailsview.cpp @@ -69,6 +69,10 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr connect(parent, SIGNAL(sortOrderChanged(Qt::SortOrder)), this, SLOT(setSortIndicatorOrder(Qt::SortOrder))); + // TODO: Connecting to the signal 'activated()' is not possible, as kstyle + // does not forward the single vs. doubleclick to it yet (KDE 4.1?). Hence it is + // necessary connecting the signal 'singleClick()' or 'doubleClick' and to handle the + // RETURN-key in keyPressEvent(). if (KGlobalSettings::singleClick()) { connect(this, SIGNAL(clicked(const QModelIndex&)), this, SLOT(slotItemActivated(const QModelIndex&))); @@ -271,6 +275,14 @@ void DolphinDetailsView::paintEvent(QPaintEvent* event) } } +void DolphinDetailsView::keyPressEvent(QKeyEvent* event) +{ + QTreeView::keyPressEvent(event); + if (event->key() == Qt::Key_Return) { + m_controller->triggerItem(selectionModel()->currentIndex()); + } +} + void DolphinDetailsView::setSortIndicatorSection(DolphinView::Sorting sorting) { QHeaderView* headerView = header(); |
