summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-10-04 11:14:24 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-10-05 09:38:31 +0200
commit8e21f46f9524986d67cc4aaccf4188d3f1887570 (patch)
tree5ac8053a94c347ba08257b09427b8a1ab7e32b3d /vcl
parentc47029a8c5b7c376638aeb37c0e17bb0a3410a75 (diff)
tdf#130857 qt a11y weld: Apply ATK/a11y properties
Set accessible name and description on the QWidget as specified in the .ui file. This e.g. makes Orca announce the a11y description of the checkboxes in the "Insert" -> "Axes" dialog newly supported by QtInstanceBuilder since Change-Id: I15901f83192ba33ddc5c5eb779be680f26cb6b55 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Fri Oct 4 10:53:28 2024 +0200 tdf#130857 qt weld: Declare support for chart "Insert Axes" dialog Change-Id: I403139577e6a932bb92da851dabd3cb994453083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174468 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/QtBuilder.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/vcl/qt5/QtBuilder.cxx b/vcl/qt5/QtBuilder.cxx
index 9c74d3f4fe96..c342e33d253b 100644
--- a/vcl/qt5/QtBuilder.cxx
+++ b/vcl/qt5/QtBuilder.cxx
@@ -244,9 +244,20 @@ void QtBuilder::setContext(QObject*, std::vector<vcl::EnumContext::Context>&&)
SAL_WARN("vcl.qt", "Ignoring context");
}
-void QtBuilder::applyAtkProperties(QObject*, const stringmap&, bool)
+void QtBuilder::applyAtkProperties(QObject* pObject, const stringmap& rProperties, bool)
{
- SAL_WARN("vcl.qt", "QtBuilder::applyAtkProperties not implemented yet");
+ if (!pObject || !pObject->isWidgetType())
+ return;
+
+ QWidget* pWidget = static_cast<QWidget*>(pObject);
+
+ for (auto const & [ rKey, rValue ] : rProperties)
+ {
+ if (rKey == "AtkObject::accessible-description")
+ pWidget->setAccessibleDescription(toQString(rValue));
+ else if (rKey == "AtkObject::accessible-name")
+ pWidget->setAccessibleName(toQString(rValue));
+ }
}
void QtBuilder::applyPackingProperties(QObject*, QObject*, const stringmap&)