PDA

View Full Version : Accessibility in Qt on Vista



bear101
26th July 2009, 11:47
Hi

I've developed a Windows application in Qt which needs to be accessible to blind users. Previously I've used MFC which works well with screen-readers.

When I start my Qt application and use a screen-reader, e.g. the Narrator in Vista, it's not able to tell what type of control is currently focused. In MFC it e.g. says that it's an edit-control whereas in my Qt app everything is just a "pane", no matter if it's a combobox or edit control. Also when I activate my menu-bar it just says "menu-bar" and doesn't tell the individual items.

I've found a few Qt articles on how to develop accessible widgets but how do I use the widgets which are already in place in Qt? Can't Qt tell the narrator what type of control is focused?

-- Bjoern

Boron
27th July 2009, 14:01
Maybe this helps: http://doc.trolltech.com/4.5/accessible.html. The section "Implementing Accessibility" seems to be the most interesting one.

bear101
27th July 2009, 20:02
But aren't Qt controls already accessible? This looks like reinventing the wheel :(

pherthyl
28th July 2009, 16:42
I've just done some testing with Inspect32 on QtCreator, and the results are in fact very disturbing. None of the controls are exposed correctly.

I've done this testing in the past, found some problems, and Trolltech corrected them, so this is a regression from past versions of Qt. I have a commercial license and will file a bug report.

UPDATE: I did some testing with Qt demo apps and they work just fine. So it seems QtCreator was compiled without accessibility support. I've reported the bug.

pherthyl
28th July 2009, 17:32
But aren't Qt controls already accessible? This looks like reinventing the wheel :(

If the standard controls aren't accessible, check if you compiled your Qt with accessibility support. It is a flag in the configure options. Also check the Qt demos with narrator. they work here, even though creator doesn't.

bear101
28th July 2009, 18:37
I haven't set the QT_NO_ACCESSIBILITY flag if that's what you're referring to. Also I remember seeing the "accessibility" configuration when I ran ./configure

But what does one have to do to enable accessibility? If I e.g. use Vista Narrator and start the following example I don't even hear the labels being spoken: C:\Qt\4.5.0\examples\dialogs\findfiles\

Isn't accessibility just "on" when the application starts? I don't remember doing anything in MFC to enable it.

-- Bjoern

pherthyl
28th July 2009, 22:41
I haven't set the QT_NO_ACCESSIBILITY flag if that's what you're referring to. Also I remember seeing the "accessibility" configuration when I ran ./configure

But what does one have to do to enable accessibility? If I e.g. use Vista Narrator and start the following example I don't even hear the labels being spoken: C:\Qt\4.5.0\examples\dialogs\findfiles\

Isn't accessibility just "on" when the application starts? I don't remember doing anything in MFC to enable it.

-- Bjoern

Very strange. It seems that with Qt compiled with MSVC accessibility is broken. That would explain why QtCreator doesn't work. I tried some of my GUI apps that are compiled with msvc and they don't work either. The Qt examples work fine, so I assume that mingw compiled exes don't have this problem.

pherthyl
28th July 2009, 23:08
It's not MSVC after all. One of my programs that's compiled against a static version of Qt with mingw has the same issue. It just seems that even though configure -help states that -accessibility is the default, it doesn't actually get enabled. Try recompiling your Qt with that flag passsed to configure, and then recompiling your program. I've updated the bug report with this info as well, but haven't tested actually recompiling Qt.

bear101
29th July 2009, 11:17
Yes, I can see that Qt doesn't add "accessibility" to c:\Qt\4.5.2\mkspecs\default\qmake.conf so I tried adding this myself and recompiled. It, however, didn't help. I also tried to add "accessibility" to my own project's .pro file but it also didn't help.

Do you know which version of Qt was last able to handle accessibility? Then I'll revert to that version.

-- Bjoern

pherthyl
29th July 2009, 16:28
Well it's not that 4.5.2 doesn't support accessibility, it does if you compile against the pre-built Qt in the SDK. However, it seems that recompiling Qt somehow disables that support. I'm going to try to recompile my version of Qt and see if I can get MSAA support to work.

I got a reply on the bug report, but no solution yet.

Last time I complained about Qt was 2005-11-16, and shortly afterwards a release came out that seemed to fix the problems I had reported. However that was quite a long time ago, I wouldn't recommend reverting to a version from then.

bear101
29th July 2009, 19:04
Good luck! And thanks a lot. Please let me know if you find a solution.

-- Bjoern

pherthyl
29th July 2009, 19:10
Reply from support:


Ah, it's clearer what you mean now. I've spoken to one of the Qt Creator developers and accessibility isn't currently supported and there are no plans to include it in future releases of Creator. This could change if there is sufficient interest from other users.

So Qt Creator is out. Although I can't imagine why they wouldn't at least enable the basic accessibility for the menu items. I'm very disappointed that an accessibility issue should be ignored until there is "sufficient interest from other users". I'm going to post to the Qt-creator list on this issue.

I've opened another support request to figure out why our apps aren't supporting MSAA.

bear101
29th July 2009, 23:09
Hm, that stinks :( One should think that it's a requirement for companies which develop software for Governments.

Btw, I've noticed when using Qt Creator that if you use the mouse to scroll over the menu-items the Narrator reads the items. Unfortunately it doesn't do it for keys.

Were you able to figure out why Qt Creator has some accessibility and a build for Visual Studio doesn't have any at all?

-- Bjoern

pherthyl
29th July 2009, 23:43
Hm, that stinks :( One should think that it's a requirement for companies which develop software for Governments.

Yes, I mentioned section 508 to them as well. Will bring it up on the list.


Btw, I've noticed when using Qt Creator that if you use the mouse to scroll over the menu-items the Narrator reads the items. Unfortunately it doesn't do it for keys.

Strange, mine doesn't say anything (except for popup start and popup end), either with the mouse or keyboard.


Were you able to figure out why Qt Creator has some accessibility and a build for Visual Studio doesn't have any at all?

Not yet. I recompiled Qt with -accessibility and will retest.

pherthyl
30th July 2009, 16:24
Just in case you have a static version of Qt, this is what Qt support has to say:


When you build with this (static) then you need to ensure that you tell qmake that you want to compile in the accessiblity plugin (after it has been built statically) into the application. Firstly you need to go to:

qt\src\plugins\accessible

and do:

mingw32-make

then add:

QTPLUGIN += qtaccessiblewidgets

to your pro file and:

Q_IMPORT_PLUGIN(qtaccessiblewidgets)

to your code. See:

http://doc.trolltech.com/4.5/plugins-howto.html#static-plugins

for more information.

pherthyl
30th July 2009, 16:26
For shared versions of Qt, they say it should work, but you can try doing just the build part of the previous comment to make sure the plugin gets loaded. I wasn't aware there was a plugin at all, so that might explain some things.

pherthyl
30th July 2009, 19:22
Ok, the revelation that the accessibility support is actually a qt plugin solved the problem for me. For my static app I can just link in the plugin, for my shared app (msvc) I just copied the "accessible" directory from the qt plugins dir into the folder my app's exe is in and it worked as well.

bear101
31st July 2009, 21:05
Thanks a lot for sharing this information from the Qt people! It also works a lot better for me now with accessibility. There's, however, some inconsistencies in what is being said by the Narrator. E.g. drop-lists are said to be editable comboboxes and tree-control items are always said to be leaf nodes with children. But at least the menu items work now and also the control names.

pherthyl
1st August 2009, 06:48
Thanks a lot for sharing this information from the Qt people! It also works a lot better for me now with accessibility. There's, however, some inconsistencies in what is being said by the Narrator. E.g. drop-lists are said to be editable comboboxes and tree-control items are always said to be leaf nodes with children. But at least the menu items work now and also the control names.

Was the drop down editable?

If not, please do report these bugs directly to Nokia.. They're not perfect with their accessibility support, but they do fix bugs when you point out specific examples.
http://www.qtsoftware.com/developer/task-tracker

I've also made the QtCreator devs aware of their missing accessibility. Looks like they already had the bug open, and my nagging just reminded them to bump the priority :)
http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=258007

Thanks for bringing up the issue.