Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Accessible Widgets

I'm trying to implement accessibility for my Qt application. I'm using NVDA (http://www.nvda-project.org/) and Freedom Scientific's JAWS (http://www.freedomscientific.com/products/fs/jaws-product-page.asp) as the screen readers I want to support.

I'm assigning the widget's accessibleName and accessibleDescription properties (http://doc.trolltech.com/4.7/qwidget.html#accessibleDescription-prop) in order to get the screen reader to read this information.

Example:

saveButton->setAccessibleName("save");
saveButton->setAccessibleDescription("Save the options you have entered above");

In both screen readers everything is working correctly when using the mouse. However, when focus changes in a widget all the readers read is "pane". Why isn't Qt providing the accessibility information that I need?

like image 973
Noah Callaway Avatar asked May 06 '26 09:05

Noah Callaway


1 Answers

You have to import a plug-in to get Qt to have accessible widgets. This lets screen readers read the names, and hierarchies of objects.

To get this, you need to add qtaccessible widgets to your qmake project file:

QTPLUGIN += qtaccessiblewidgets

And in main.cpp add a Q_IMPORT_PLUGIN

Q_IMPORT_PLUGIN(qtaccessiblewidgets)

Then screen readers will be able to accurately read:

"Button. Save. Save the options you have entered above. Press space to activate the button."

When you tab to (or otherwise place focus on) a button

like image 103
Noah Callaway Avatar answered May 09 '26 16:05

Noah Callaway



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!