diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/widgets/kernel/qwidget.cpp | 7 | ||||
| -rw-r--r-- | src/widgets/kernel/qwidget_p.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 6ef8b76672f..e57aba3a56e 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -6853,6 +6853,13 @@ QWidget *QWidget::focusWidget() const return const_cast<QWidget *>(d_func()->focus_child); } +QObject *QWidgetPrivate::focusObject() +{ + Q_Q(QWidget); + QWidget *proxy = deepestFocusProxy(); + return proxy ? proxy : q; +} + /*! Returns the next widget in this widget's focus chain. diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 2e1c4030f80..07153e71293 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -579,7 +579,7 @@ public: inline QRect mapFromWS(const QRect &r) const { return r.translated(data.wrect.topLeft()); } - virtual QObject *focusObject() { return nullptr; } + virtual QObject *focusObject(); virtual QPlatformBackingStoreRhiConfig rhiConfig() const { return {}; } |
