diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-08-06 18:10:28 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-08-07 07:12:10 +0200 |
commit | f9fccb9023a2610480dde60d570d2b3f3169de57 (patch) | |
tree | 75a1ce6115addfde29f831f98ca419639313e5bf /vcl | |
parent | 70b6d20e930453a963118744c747fb08935a86ee (diff) |
tdf#130857 qt weld: Implement QtInstanceWidget::has_child_focus
Change-Id: I97ac73943969ecb8f1f189adc1cf4b5c4b052fd1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171558
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/QtInstanceWidget.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index bdeb1bf83f3a..f5f359b536c3 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -65,7 +65,20 @@ bool QtInstanceWidget::has_focus() const bool QtInstanceWidget::is_active() const { return has_focus(); } -bool QtInstanceWidget::has_child_focus() const { return true; } +bool QtInstanceWidget::has_child_focus() const +{ + QWidget* pFocusWidget = QApplication::focusWidget(); + if (!pFocusWidget) + return false; + + QWidget* pParent = pFocusWidget->parentWidget(); + while (pParent) + { + if (pParent == m_pWidget) + return true; + } + return false; +} void QtInstanceWidget::show() {} |