Please nominate your Qt Champions for 2021! https://forum.qt.io/topic/132134/looking-for-the-2021-qt-champions
I have some problems with the Qt Accessibility API, maybe some of you can help me with them.
So first of all, my main problem is that I can't seem to be able to get any new feedback from the screen reader when calling the QAccessbile::updateAccessbility static method.
For example, I have a Custom class that inherits QSlider and I'm updating the value of the slider. Shouldn't this code make the screen-reader tell the new value of the slider?
QAccessibleValueChangeEvent event(this, value());
Am I doing something wrong here?
- Must a widget have focus when QAccessible::updateAccessibility method is called?
- If the answer to the previous question is yes, how can I make the screen-reader see the informations for QObjets since they can't get focus?
- Is there a way to send a string to the screen-reader and say something like "read this"?
Disclaimer: I'm no specialist in this field. There's currently work done to improve accessibility support, have a look at Qt's mailing list on the subject.
AFAIK, QSlider should already be accessible aware, so I wonder if you really need to add that code. Anyway, something looks wrong here:
@QAccessibleValueChangeEvent event(this, value());@
None of the constructors take a value as a parameter.
By the way, which version of Qt and on which OS are you working ?
Hello, SGaist! Thanks for your reply!
I'm running Qt 5.3 on Windows 7.
I know that there is still work being done, but I don't know what is finished and what isn't. I already tried the Accessibility mailing list, but nobody answered... After creating this post I also sent a bug report, because I've tried this for over a week now. I've uploaded the whole testing project there.
Yes, the QSlider already has accessibility implemented already, but this is just a project for testing. In the project that I'm supposed to add support for accessibility there are a lot of custom classes, that should have custom behavior, that's why I'm trying to implement this myself.
The QAccessibleChangeEvent, has a QVariant as a second parameter. Isn't that the way to create it? I have to say that I don't understand completly how QVariant works, but I also tried instantiating other kinds of events that don't have it and don't work either.
What I'm really interesed in telling the screen-reader that the accessibility informations have changed and I want it to read them. For example if I put a message in the status bar, I want it to read that message.
No such event...
There is however the QAccessibleEvent(QObject o, QAccessible::Event)
where I can set the Event type to anything I want. The code that I gave is just an example. I don't receive any update, no matter what type of event I'm using.
But does the QAccessibleValueChangeEvent do anything for you? Or for that matter calling the QAccessible::updateAccessibility method? Does the screen-reader tell you anything new?