vcl/inc/qt5/QtInstanceWidget.hxx | 2 +- vcl/qt5/QtInstanceBuilder.cxx | 7 +++++++ vcl/qt5/QtInstanceWidget.cxx | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-)
New commits: commit 99e1b47caec8fed5d29ffee7d5f178f8e47155e8 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jan 14 13:57:45 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jan 15 01:34:55 2026 +0100 tdf#130857 tdf#162703 tdf#162704 qt weld: Support sw "Field" dialog This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. The dialog can be triggered like this: * start Writer * "Insert" -> "Field" -> "More Fields" Using native widgets also avoids the issue of rendering artifacts for the TextView as seen when using vcl widgets as described in tdf#162703 and tdf#162704. Change-Id: Ifd2a5378c27b656a49d577d32022b85fe32f2004 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197272 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 496412bcc589..ec3ab38b2f82 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -180,6 +180,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"modules/swriter/ui/createauthorentry.ui"_ustr, u"modules/swriter/ui/editcategories.ui"_ustr, u"modules/swriter/ui/endnotepage.ui"_ustr, + u"modules/swriter/ui/fielddialog.ui"_ustr, u"modules/swriter/ui/footendnotedialog.ui"_ustr, u"modules/swriter/ui/footnotepage.ui"_ustr, u"modules/swriter/ui/inforeadonlydialog.ui"_ustr, @@ -279,6 +280,12 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"modules/simpress/ui/annotationtagmenu.ui"_ustr, u"modules/swriter/ui/bibliofragment.ui"_ustr, u"modules/swriter/ui/columnpage.ui"_ustr, + u"modules/swriter/ui/flddbpage.ui"_ustr, + u"modules/swriter/ui/flddocinfopage.ui"_ustr, + u"modules/swriter/ui/flddocumentpage.ui"_ustr, + u"modules/swriter/ui/fldfuncpage.ui"_ustr, + u"modules/swriter/ui/fldrefpage.ui"_ustr, + u"modules/swriter/ui/fldvarpage.ui"_ustr, u"modules/swriter/ui/optcaptionpage.ui"_ustr, u"modules/swriter/ui/printoptionspage.ui"_ustr, u"modules/swriter/ui/statisticsinfopage.ui"_ustr, commit 454ed2e6ac4c1d99d39ba44096af17d8348abe03 Author: Michael Weghorn <[email protected]> AuthorDate: Wed Jan 14 13:36:37 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Thu Jan 15 01:34:47 2026 +0100 tdf#130857 qt weld a11y: Implement set_accessible_relation_labeled_by The primary purpose of the labelled-by a11y relation is that the labelling widget's accessible name gets announced when the widget it labels receives focus. While QWidget doesn't have any API to set a "random" widget as the accessible label, setting the widget's accessible name to the same one as the labelling widget has the same effect in that regard, so do that for now. (This would break if the labelling's widget's a11y name were changing after it being set as the label.) This is used e.g. in Writer's "Insert" -> "Field" -> "More Fields" dialog, in the "Database" tab, when selecting the "Mail merge fields" type. (Support for using native Qt widgets for that dialog hasn't been declared yet, but this is one step to prepare for that.) (For the cases where the labelling widget is a weld::Label, weld::Label::set_mnemonic_widget is the better choice as the QtInstanceLabel::set_mnemonic_widget implementation then sets the QLabel buddy which also results in the a11y relations getting set.) Change-Id: I74817648a83bd31d144eaa41a845fe2cae003ed0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197271 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/inc/qt5/QtInstanceWidget.hxx b/vcl/inc/qt5/QtInstanceWidget.hxx index 25925defa72d..70adb55d894c 100644 --- a/vcl/inc/qt5/QtInstanceWidget.hxx +++ b/vcl/inc/qt5/QtInstanceWidget.hxx @@ -112,7 +112,7 @@ public: virtual OUString get_accessible_id() const override; - virtual void set_accessible_relation_labeled_by(weld::Widget*) override; + virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) override; virtual void set_tooltip_text(const OUString& rTip) override; diff --git a/vcl/qt5/QtInstanceWidget.cxx b/vcl/qt5/QtInstanceWidget.cxx index 3f9f5fc5e630..6bd2573867c6 100644 --- a/vcl/qt5/QtInstanceWidget.cxx +++ b/vcl/qt5/QtInstanceWidget.cxx @@ -602,9 +602,11 @@ OUString QtInstanceWidget::get_accessible_id() const #endif } -void QtInstanceWidget::set_accessible_relation_labeled_by(weld::Widget*) +void QtInstanceWidget::set_accessible_relation_labeled_by(weld::Widget* pLabel) { - assert(false && "Not implemented yet"); + // QWidget doesn't have API to set a random widget as a11y label, + // take over the accessible name from the labelling widget instead + set_accessible_name(pLabel->get_accessible_name()); } void QtInstanceWidget::set_tooltip_text(const OUString& rTip)
