Clear highlighted bytes on ESC press, in snpashot diff window

This commit is contained in:
Nav
2023-08-24 00:39:57 +01:00
parent 9e4f5988fb
commit b07be04a3c
2 changed files with 13 additions and 0 deletions

View File

@@ -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");

View File

@@ -3,6 +3,7 @@
#include <QWidget>
#include <QShowEvent>
#include <QResizeEvent>
#include <QKeyEvent>
#include <QHBoxLayout>
#include <QPlainTextEdit>
#include <optional>
@@ -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;