Re: building accessible user interface with python #3030-advice

Toni Barth

Am 13.04.2020 um 12:36 schrieb UMIT ERDEM Yigitoglu:
Thank you to everyone,
sean, I was just thinking about what you said about labelling. I have read some introductory material on Pqt5 but there is not much information on labelling or other possible accessibility features on them. for example QLabel("hello") commend create a text "hello on the application but I can not reach it. should ı go through those introductory material and wait for more advance subjects to learn them or is there more accessibility oriented material you can recommend to me?  in short how did you learn gui tools?

Labels aren't ment to be navigated to usually. Labels are ment to be used in conjunction with other widgets to show what the widget is all about. For example, if you place a multi-line edit on the screen, even for sighted people, that widget is just a box with a cursor in it. By placing a label above or to the left of the box with the text 'Enter your program code here', sighted people will know what the edit is actually ment to do. The same goes for screen reading software. Whenever you place a widget and navigate to it with screen reading software like NVDA, this software will try to find a label which is positioned as closely to this widget as possible. I don't know if the order of creation programatically or the visual appearance is actually important here, but you'll be on the safe side if you try to keep both as close as possible. If a label is actually found, NVDA will automatically show the text displayed in the label as information when tabbing to the related widget.

You can try to strengthen the relationship between label and widget in Qt5 by using the buddy functionality, e.g. add the label as a buddy to the widget (widget.setBuddy(label)). I don't know if this is actually related in any way or another, but doing it didn't hurt my projects written with the help of PyQt5 yet.

Best Regards.

Toni Barth

Join to automatically receive all group messages.