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&)));
}
}
+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();
virtual void dragMoveEvent(QDragMoveEvent* event);
virtual void dropEvent(QDropEvent* event);
virtual void paintEvent(QPaintEvent* event);
+ virtual void keyPressEvent(QKeyEvent* event);
private slots:
/**
setMouseTracking(true);
viewport()->setAttribute(Qt::WA_Hover);
+ // 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&)),
controller, SLOT(triggerItem(const QModelIndex&)));
}
}
+void DolphinIconsView::keyPressEvent(QKeyEvent* event)
+{
+ KCategorizedView::keyPressEvent(event);
+ if (event->key() == Qt::Key_Return) {
+ m_controller->triggerItem(selectionModel()->currentIndex());
+ }
+}
+
void DolphinIconsView::slotShowPreviewChanged(bool showPreview)
{
updateGridSize(showPreview, m_controller->showAdditionalInfo());
virtual void dragMoveEvent(QDragMoveEvent* event);
virtual void dropEvent(QDropEvent* event);
virtual void paintEvent(QPaintEvent* event);
+ virtual void keyPressEvent(QKeyEvent* event);
private slots:
void slotShowPreviewChanged(bool show);
applyViewProperties(url);
startDirLister(url);
+ itemView()->setFocus();
}
void DolphinView::mouseReleaseEvent(QMouseEvent* event)
this, SLOT(emitContentsMoved()));
connect(view->horizontalScrollBar(), SIGNAL(valueChanged(int)),
this, SLOT(emitContentsMoved()));
+ view->setFocus();
}
QAbstractItemView* DolphinView::itemView() const