diff --git a/src/EditDialog.ui b/src/EditDialog.ui
index 63025988..97a1083d 100644
--- a/src/EditDialog.ui
+++ b/src/EditDialog.ui
@@ -160,8 +160,8 @@
0
0
- 83
- 40
+ 98
+ 35
@@ -212,6 +212,9 @@
-
+
+ Apply data to cell [Ctrl+Return]
+
Apply
diff --git a/src/ExtendedTableWidget.cpp b/src/ExtendedTableWidget.cpp
index d452cd60..5e38593f 100644
--- a/src/ExtendedTableWidget.cpp
+++ b/src/ExtendedTableWidget.cpp
@@ -95,6 +95,13 @@ ExtendedTableWidget::ExtendedTableWidget(QWidget* parent) :
m_contextMenu->addAction(pasteAction);
setContextMenuPolicy(Qt::CustomContextMenu);
+ // This is only for displaying the shortcut in the context menu.
+ // An entry in keyPressEvent is still needed.
+ nullAction->setShortcut(QKeySequence(tr("Alt+Del")));
+ copyAction->setShortcut(QKeySequence::Copy);
+ copyWithHeadersAction->setShortcut(QKeySequence(tr("Ctrl+H")));
+ pasteAction->setShortcut(QKeySequence::Paste);
+
// Set up context menu actions
connect(this, &QTableView::customContextMenuRequested,
[=](const QPoint& pos)
@@ -389,11 +396,14 @@ void ExtendedTableWidget::keyPressEvent(QKeyEvent* event)
// Call a custom copy method when Ctrl-C is pressed
if(event->matches(QKeySequence::Copy))
{
- copy();
+ copy(false);
return;
} else if(event->matches(QKeySequence::Paste)) {
- // Call a custom paste method when Ctrl-P is pressed
+ // Call a custom paste method when Ctrl-V is pressed
paste();
+ } else if(event->modifiers().testFlag(Qt::ControlModifier) && (event->key() == Qt::Key_H)) {
+ // Call copy with headers when Ctrl-H is pressed
+ copy(true);
} else if(event->key() == Qt::Key_Tab && hasFocus() &&
selectedIndexes().count() == 1 &&
selectedIndexes().at(0).row() == model()->rowCount()-1 && selectedIndexes().at(0).column() == model()->columnCount()-1) {
diff --git a/src/MainWindow.ui b/src/MainWindow.ui
index 779ac1ee..894712e3 100644
--- a/src/MainWindow.ui
+++ b/src/MainWindow.ui
@@ -22,7 +22,7 @@
-
- 0
+ 1
@@ -130,7 +130,7 @@
-
- Refresh the data in the selected table.
+ Refresh the data in the selected table [F5, Ctrl+R]
This button refreshes the data in the currently selected table.