SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CRightClickEnabler Class Reference

#include <crightclickenabler.h>

Inherits QObject.

Signals

void rightClick (const QPoint &)
 

Public Member Functions

 CRightClickEnabler (QAbstractButton *button)
 

Protected Member Functions

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

Private Attributes

QAbstractButton * _button
 

Detailed Description

Definition at line 27 of file crightclickenabler.h.

Constructor & Destructor Documentation

◆ CRightClickEnabler()

CRightClickEnabler::CRightClickEnabler ( QAbstractButton *  button)

Definition at line 10 of file crightclickenabler.cpp.

10  : QObject(button), _button(button) {
11  button->installEventFilter(this);
12 };
QAbstractButton * _button

Member Function Documentation

◆ eventFilter()

bool CRightClickEnabler::eventFilter ( QObject *  watched,
QEvent *  event 
)
inlineoverrideprotected

Definition at line 36 of file crightclickenabler.h.

37  {
38  (void) watched;
39 
40  if (event->type() == QEvent::MouseButtonPress)
41  {
42  auto mouseEvent = (QMouseEvent*) event;
43 
44  if (mouseEvent->button() == Qt::RightButton) {
45  emit rightClick(mouseEvent->globalPos());
46  }
47  }
48 
49  return false;
50  }
void rightClick(const QPoint &)

◆ rightClick

void CRightClickEnabler::rightClick ( const QPoint &  )
signal

Member Data Documentation

◆ _button

QAbstractButton* CRightClickEnabler::_button
private

Definition at line 53 of file crightclickenabler.h.


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