mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Add keyboard shortcuts for switching the currently browsed table
Add two new keyboard shortcuts for switching the currently selected table in the Browse Data tab. These work as long as the table widget is active. For now I have set them to Ctrl+PageUp and Ctrl+PageDown. See issue #536.
This commit is contained in:
@@ -300,9 +300,8 @@ void ExtendedTableWidget::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
copy();
|
||||
return;
|
||||
// Call a custom paste method when Ctrl-P is pressed
|
||||
} else if(event->matches(QKeySequence::Paste))
|
||||
{
|
||||
} else if(event->matches(QKeySequence::Paste)) {
|
||||
// Call a custom paste method when Ctrl-P is pressed
|
||||
paste();
|
||||
} else if(event->key() == Qt::Key_Tab && hasFocus() &&
|
||||
selectedIndexes().count() == 1 &&
|
||||
@@ -320,6 +319,10 @@ void ExtendedTableWidget::keyPressEvent(QKeyEvent* event)
|
||||
foreach(const QModelIndex& index, selectedIndexes())
|
||||
model()->setData(index, "");
|
||||
}
|
||||
} else if(event->modifiers().testFlag(Qt::ControlModifier) && (event->key() == Qt::Key_PageUp || event->key() == Qt::Key_PageDown)) {
|
||||
// When pressing Ctrl + Page up/down send a signal indicating the user wants to change the current table
|
||||
emit switchTable(event->key() == Qt::Key_PageDown);
|
||||
return;
|
||||
}
|
||||
|
||||
// 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,
|
||||
|
||||
Reference in New Issue
Block a user