From 5b53040190b29e8434ad540623e48bbb8b92b3f6 Mon Sep 17 00:00:00 2001 From: Nav Date: Tue, 19 Jul 2022 22:30:23 +0100 Subject: [PATCH] Moved closeEvent() handler from MemoryInspectionPaneWidget to base class PaneWidget --- .../UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp | 6 ++++++ .../UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp | 2 ++ .../TargetMemoryInspectionPane.cpp | 5 ----- .../TargetMemoryInspectionPane.hpp | 1 - 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp index 27e94538..a021b5f3 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.cpp @@ -52,4 +52,10 @@ namespace Bloom::Widgets this->attached = true; emit this->paneAttached(); } + + void PaneWidget::closeEvent(QCloseEvent* event) { + this->deactivate(); + QWidget::closeEvent(event); + } + } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp index f4e59056..ec9cf44b 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/PaneWidget.hpp @@ -36,5 +36,7 @@ namespace Bloom::Widgets protected: void detach(); void attach(); + + void closeEvent(QCloseEvent* event) override; }; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index eeecea05..4fdf06db 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -261,11 +261,6 @@ namespace Bloom::Widgets this->container->setFixedSize(size.width() - 1, size.height()); } - void TargetMemoryInspectionPane::closeEvent(QCloseEvent* event) { - this->deactivate(); - QWidget::closeEvent(event); - } - void TargetMemoryInspectionPane::postActivate() { if ( this->settings.refreshOnActivation diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp index 5fd24d96..29fb0011 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.hpp @@ -38,7 +38,6 @@ namespace Bloom::Widgets protected: void resizeEvent(QResizeEvent* event) override; - void closeEvent(QCloseEvent* event) override; void postActivate(); void postDeactivate();