forked from qt-creator/qt-creator
Fixes: - Using Return in project tree on Mac to open files
This commit is contained in:
@@ -90,6 +90,20 @@ protected:
|
||||
if (event->reason() != Qt::PopupFocusReason)
|
||||
QTreeView::focusOutEvent(event);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
void keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
if ((event->key() == Qt::Key_Return
|
||||
|| event->key() == Qt::Key_Enter)
|
||||
&& event->modifiers() == 0
|
||||
&& currentIndex().isValid()) {
|
||||
emit activated(currentIndex());
|
||||
return;
|
||||
}
|
||||
QTreeView::keyPressEvent(event);
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user