diff --git a/gui/clicklabel.cpp b/gui/clicklabel.cpp index 77786f6..ebd7832 100644 --- a/gui/clicklabel.cpp +++ b/gui/clicklabel.cpp @@ -3,9 +3,13 @@ void ClickLabel::mousePressEvent(QMouseEvent *event) { - if(event->button() == Qt::LeftButton) - { - emit leftClick(); - } - return QLabel::mousePressEvent(event); + if(event->button() == Qt::LeftButton) + { + emit leftClick(); + } + if(event->button() == Qt::RightButton) + { + emit rightClick(); + } + return QLabel::mousePressEvent(event); } diff --git a/gui/clicklabel.h b/gui/clicklabel.h index cd695aa..e4a5bbb 100644 --- a/gui/clicklabel.h +++ b/gui/clicklabel.h @@ -1,17 +1,18 @@ #ifndef CLICKLABEL_H #define CLICKLABEL_H #include +#include class ClickLabel : public QLabel { - Q_OBJECT + Q_OBJECT public: - using QLabel::QLabel; + using QLabel::QLabel; signals: - void leftClick(); + void leftClick(); + void rightClick(); protected: - void mousePressEvent(QMouseEvent *event); - + void mousePressEvent(QMouseEvent *event); }; #endif // CLICKLABEL_H