From a227c54e40e5f441590fb262c3cb5a966dd104bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20M=C3=BCller?= Date: Fri, 29 Sep 2017 13:12:31 +0200 Subject: [PATCH] Add save screenshot shortcut to main window --- interface.cpp | 1 + mainwindow.h | 3 ++- mainwindow_constr.cpp | 5 +++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/interface.cpp b/interface.cpp index 5851231..110e8a5 100644 --- a/interface.cpp +++ b/interface.cpp @@ -1978,6 +1978,7 @@ void UI_Mainwindow::show_howto_operate() "Press 'c' to center the horizontal position.\n" "Press 't' to center the trigger position.\n" "Press 'f' to toggle FFT.\n" + "Press 'p' to save a screenshot.\n" ); msgBox.exec(); diff --git a/mainwindow.h b/mainwindow.h index a129623..208ef04 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -231,7 +231,8 @@ private: *select_chan4_act, *toggle_fft_act, *center_trigger_act, - *center_position_act; + *center_position_act, + *save_screenshot_act; struct tmcdev *device; diff --git a/mainwindow_constr.cpp b/mainwindow_constr.cpp index c541fa0..641ea4a 100644 --- a/mainwindow_constr.cpp +++ b/mainwindow_constr.cpp @@ -509,6 +509,11 @@ UI_Mainwindow::UI_Mainwindow() toggle_fft_act = new QAction(this); toggle_fft_act->setShortcut(QKeySequence("f")); addAction(toggle_fft_act); + + save_screenshot_act = new QAction(this); + save_screenshot_act->setShortcut(QKeySequence("p")); + connect(save_screenshot_act, SIGNAL(triggered()), this, SLOT(save_screenshot())); + addAction(save_screenshot_act); DPRwidget->setEnabled(false);