BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
RightMouseButtonEater Class Reference

Description

Filter out right mouse button events.

Definition at line 90 of file CustomEventFilters.h.

Inheritance diagram for RightMouseButtonEater:
[legend]
Collaboration diagram for RightMouseButtonEater:
[legend]

Public Member Functions

 RightMouseButtonEater (QObject *parent=nullptr)
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 

Constructor & Destructor Documentation

◆ RightMouseButtonEater()

RightMouseButtonEater::RightMouseButtonEater ( QObject *  parent = nullptr)

Definition at line 140 of file CustomEventFilters.cpp.

141  : QObject(parent)
142 {
143 }

Member Function Documentation

◆ eventFilter()

bool RightMouseButtonEater::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Definition at line 145 of file CustomEventFilters.cpp.

146 {
147  if (event->type() != QEvent::MouseButtonPress)
148  // standard event processing
149  return QObject::eventFilter(obj, event);
150  auto* mouseEvent = dynamic_cast<QMouseEvent*>(event);
151  if (mouseEvent->button() == Qt::RightButton) {
152  event->ignore();
153  return true;
154  }
155  event->accept();
156  return false;
157 }

The documentation for this class was generated from the following files: