diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-08-06 17:34:03 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-08-07 07:11:39 +0200 |
commit | a8d894be5d6f39b9dde6f144858f58bb1081eb12 (patch) | |
tree | a9a711698ef0246f2cbfc3d1534fb282f19a1b91 /vcl/qt5 | |
parent | 0d8d95cadf4ead4418bdae5bc519a944a2fae260 (diff) |
tdf#130857 qt weld: Implement QtInstanceWidget::{get,is}_visible
Implement according to the comments in include/vcl/weld.hxx:
// return if this widget's visibility is true
virtual bool get_visible() const = 0;
// return if this widget's visibility and that of all its parents is true
virtual bool is_visible() const = 0;
Change-Id: Ic3a6193b04094331ec3818620c078269409c4fad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171555
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/QtInstanceWidget.cxx | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index 9999bf236ee8..602b278e8eb7 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -27,9 +27,20 @@ bool QtInstanceWidget::get_sensitive() const return m_pWidget->isEnabled(); } -bool QtInstanceWidget::get_visible() const { return true; } +bool QtInstanceWidget::get_visible() const +{ + assert(m_pWidget); + return m_pWidget->isVisible(); +} -bool QtInstanceWidget::is_visible() const { return true; } +bool QtInstanceWidget::is_visible() const +{ + assert(m_pWidget); + + QWidget* pTopLevel = m_pWidget->topLevelWidget(); + assert(pTopLevel); + return m_pWidget->isVisibleTo(pTopLevel) && pTopLevel->isVisible(); +} void QtInstanceWidget::set_can_focus(bool) {} |