EditDialog: Make edit dock more keyboard friendly to use

See #440, #441.
This commit is contained in:
Martin Kleusberg
2015-12-19 14:05:45 +01:00
parent f26df79961
commit 672b6f693b
6 changed files with 38 additions and 24 deletions

View File

@@ -86,6 +86,10 @@ void ExtendedTableWidget::keyPressEvent(QKeyEvent* event)
foreach(const QModelIndex& index, selectedIndexes())
model()->setData(index, "");
}
} else if(event->key() == Qt::Key_Return && selectedIndexes().count() == 1) {
// When hitting the return key simulate a double click. This way you can change the focus to the editor dock when pressing the
// return key for advanced editing, just like a double click would open the edit dialog
emit doubleClicked(selectedIndexes().at(0));
}
// This prevents the current selection from being changed when pressing tab to move to the next filter. Note that this is in an 'if' condition,