mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Fix opening of edit dialog when pressing the return key
Pressing the return key opens the edit dialog or moves focus to the edit dock (whichever is used). However, when using the edit *dialog* doing inline editing and then hitting the return key opens the edit dialog instead of just saving the changes. This is changed by this commit. See issue #480.
This commit is contained in:
@@ -210,7 +210,7 @@ void ExtendedTableWidget::keyPressEvent(QKeyEvent* event)
|
||||
foreach(const QModelIndex& index, selectedIndexes())
|
||||
model()->setData(index, "");
|
||||
}
|
||||
} else if(event->key() == Qt::Key_Return && selectedIndexes().count() == 1) {
|
||||
} else if(event->key() == Qt::Key_Return && selectedIndexes().count() == 1 && state() != QTableView::EditingState) {
|
||||
// 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));
|
||||
|
||||
Reference in New Issue
Block a user