nodeparamview: allow disconnecting nodes by right clicking the "connected to" label

This commit is contained in:
itsmattkc
2020-06-16 17:48:10 +10:00
parent f107c9bba1
commit 67ee78ac9a
3 changed files with 27 additions and 4 deletions
+8 -4
View File
@@ -20,6 +20,8 @@
#include "clickablelabel.h"
#include <QMouseEvent>
OLIVE_NAMESPACE_ENTER
ClickableLabel::ClickableLabel(const QString &text, QWidget *parent) :
@@ -32,16 +34,18 @@ ClickableLabel::ClickableLabel(QWidget *parent) :
{
}
void ClickableLabel::mouseReleaseEvent(QMouseEvent *)
void ClickableLabel::mouseReleaseEvent(QMouseEvent *event)
{
if (underMouse()) {
if (event->button() == Qt::LeftButton && underMouse()) {
emit MouseClicked();
}
}
void ClickableLabel::mouseDoubleClickEvent(QMouseEvent *)
void ClickableLabel::mouseDoubleClickEvent(QMouseEvent *event)
{
emit MouseDoubleClicked();
if (event->button() == Qt::LeftButton) {
emit MouseDoubleClicked();
}
}
OLIVE_NAMESPACE_EXIT