#include <QMouseEvent>...bool AWS::eventFilter(QObject *obj, QEvent *event){ if (event->type() == QEvent::MouseButtonPress) { QMouseEvent *mouseEvent = static_cast<QMouseEvent *>(event); if(mouseEvent->button() == Qt::RightButton) qDebug("MouseButtonPress == Qt::RightButton"); return true; } else { // standard event processing return QObject::eventFilter(obj, event); }}
btnGroupDialogStatus = new QButtonGroup(this);btnGroupDialogStatus->addButton(ui->btnStatusPowerSystem, 0);...btnGroupDialogStatus->installEventFilter(this);