Propagate tab events from focusProxy to parent.
Definition at line 101 of file CustomEventFilters.h.
|
bool | eventFilter (QObject *obj, QEvent *event) override |
|
◆ TabFromFocusProxy()
TabFromFocusProxy::TabFromFocusProxy |
( |
QWidget * |
parent = nullptr | ) |
|
◆ eventFilter()
bool TabFromFocusProxy::eventFilter |
( |
QObject * |
obj, |
|
|
QEvent * |
event |
|
) |
| |
|
overrideprotected |
Definition at line 171 of file CustomEventFilters.cpp.
173 if (event->type() == QEvent::KeyPress) {
174 auto* keyEvent =
dynamic_cast<QKeyEvent*
>(event);
175 if (keyEvent->key() == Qt::Key_Tab || keyEvent->key() == Qt::Key_Backtab) {
177 QApplication::postEvent(
178 m_parent,
new QKeyEvent(keyEvent->type(), keyEvent->key(), keyEvent->modifiers()));
185 else if (event->type() == QEvent::FocusOut) {
186 auto* focusEvent =
dynamic_cast<QFocusEvent*
>(event);
187 QApplication::postEvent(
this,
new QFocusEvent(focusEvent->type(), focusEvent->reason()));
193 return QObject::eventFilter(obj, event);
References m_parent.
◆ m_parent
QWidget* TabFromFocusProxy::m_parent |
|
protected |
The documentation for this class was generated from the following files: