From 9680f06df845f21003dd3b17e8a0fcb6904abf7a Mon Sep 17 00:00:00 2001 From: Nav Date: Thu, 2 Sep 2021 21:20:09 +0100 Subject: [PATCH] Right click signal for clickable widget --- .../UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp | 3 +++ .../UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp index b1afec9e..e4f64c7a 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.cpp @@ -5,6 +5,9 @@ using namespace Bloom::Widgets; void ClickableWidget::mouseReleaseEvent(QMouseEvent* event) { if (event->button() == Qt::MouseButton::LeftButton) { emit this->clicked(); + + } else if (event->button() == Qt::MouseButton::RightButton) { + emit this->rightClicked(); } QWidget::mouseReleaseEvent(event); diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp index 8abf2924..874e15b9 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/ClickableWidget.hpp @@ -17,6 +17,7 @@ namespace Bloom::Widgets explicit ClickableWidget(QWidget* parent): QFrame(parent) {}; signals: + void rightClicked(); void clicked(); void doubleClicked();