From 96928e559e0ce218501eb80d2ad62af6b7f6ffda Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 14 Mar 2023 21:56:43 +0000 Subject: [PATCH] Ctrl+R shortcut for refreshing memory inspection panes --- .../TargetMemoryInspectionPane.cpp | 7 +++++++ .../TargetMemoryInspectionPane.hpp | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 0d2dda1c..18cd123c 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -409,6 +409,13 @@ namespace Bloom::Widgets PaneWidget::resizeEvent(event); } + void TargetMemoryInspectionPane::keyPressEvent(QKeyEvent* event) { + if ((event->modifiers() & Qt::ControlModifier) != 0 && event->key() == Qt::Key::Key_R) { + this->refreshButton->click(); + event->accept(); + } + } + void TargetMemoryInspectionPane::postActivate() { if ( (this->settings.refreshOnActivation || !this->data.has_value()) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp index 0c4f1174..35aa1308 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp @@ -6,6 +6,7 @@ #include #include #include +#include #include "src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp" @@ -42,6 +43,7 @@ namespace Bloom::Widgets protected: void resizeEvent(QResizeEvent* event) override; + void keyPressEvent(QKeyEvent* event) override; void postActivate(); void postDeactivate();