BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelView::LostFocusFilter Class Reference

Event filter to prevent loss of the focus. More...

Inheritance diagram for ModelView::LostFocusFilter:
[legend]
Collaboration diagram for ModelView::LostFocusFilter:
[legend]

Public Member Functions

 LostFocusFilter (QObject *parent=nullptr)
 

Protected Member Functions

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

Detailed Description

Event filter to prevent loss of the focus.

Can be used in the context of QTreeView and similar widgets to call external editor. Such an editor is created by clicking on a cell of a tree and it appears as modal window on top of a tree.

Definition at line 28 of file customeventfilters.h.

Constructor & Destructor Documentation

◆ LostFocusFilter()

LostFocusFilter::LostFocusFilter ( QObject *  parent = nullptr)

Definition at line 22 of file customeventfilters.cpp.

22 : QObject(parent) {}

Member Function Documentation

◆ eventFilter()

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

Definition at line 24 of file customeventfilters.cpp.

25 {
26  if (event->type() == QEvent::FocusOut)
27  return true;
28 
29  return QObject::eventFilter(obj, event);
30 }

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