diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.cpp index 43a22fc5..db958fd4 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.cpp @@ -138,6 +138,17 @@ namespace Widgets QWidget::resizeEvent(event); } + void SnapshotDiff::keyPressEvent(QKeyEvent* keyEvent) { + const auto key = keyEvent->key(); + + if (key == Qt::Key_Escape) { + this->hexViewerWidgetA->clearHighlighting(); + this->hexViewerWidgetB->clearHighlighting(); + } + + QWidget::keyPressEvent(keyEvent); + } + void SnapshotDiff::init() { this->setWindowFlag(Qt::Window); this->setObjectName("snapshot-diff"); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.hpp index 67ea97c1..f48624d7 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/SnapshotManager/SnapshotDiff/SnapshotDiff.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,7 @@ namespace Widgets protected: void showEvent(QShowEvent* event) override; void resizeEvent(QResizeEvent* event) override; + void keyPressEvent(QKeyEvent* keyEvent) override; private: SnapshotDiffSettings settings;