From 130e5aaf666100ce9b730d34aa5cf77edd5d3a9f Mon Sep 17 00:00:00 2001 From: Duke Leto Date: Tue, 11 Feb 2020 11:33:57 -0500 Subject: [PATCH] Detect left vs right button clicks --- src/mainwindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ff26327..f7f1327 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -672,6 +672,15 @@ bool MainWindow::eventFilter(QObject *object, QEvent *event) { return true; } else if (event->type() == QEvent::MouseButtonPress) { qDebug() << __func__ <<": "<<" mouse button event"; + QMouseEvent *ev = static_cast(event); + if (ev->buttons() & Qt::RightButton) + { + qDebug()<< "RightButton clicked"; + } + if (ev->buttons() & Qt::LeftButton) + { + qDebug()<< "LeftButton clicked"; + } } return QObject::eventFilter(object, event);