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

Description

Lisens for press-del-key events.

Definition at line 46 of file CustomEventFilters.h.

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

Signals

void removeItem ()
 

Public Member Functions

 DeleteEventFilter (QObject *parent=nullptr)
 

Protected Member Functions

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

Constructor & Destructor Documentation

◆ DeleteEventFilter()

DeleteEventFilter::DeleteEventFilter ( QObject *  parent = nullptr)
inline

Definition at line 49 of file CustomEventFilters.h.

50  : QObject(parent)
51  {
52  }

Member Function Documentation

◆ eventFilter()

bool DeleteEventFilter::eventFilter ( QObject *  dist,
QEvent *  event 
)
overrideprotected

Definition at line 80 of file CustomEventFilters.cpp.

81 {
82  Q_UNUSED(dist);
83  if (event->type() == QEvent::KeyPress) {
84  auto* keyEvent = dynamic_cast<QKeyEvent*>(event);
85  if (keyEvent->key() == Qt::Key_Delete)
86  emit removeItem();
87  }
88  return QObject::eventFilter(dist, event);
89 }

References removeItem().

◆ removeItem

void DeleteEventFilter::removeItem ( )
signal

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