What is the best method to set a font size if you want the Qt software to be easy to use for people with visual impairments?
-
Hello,
I program accessible software with Python and Qt.
I found the following 2 ways to set the font size:window.setStyleSheet('font-size: 30px')
And
font = QFont() font.setPointSize(20) # Set font size to 2.0rem window.setFont(font)
Which option is better?
-
@PythonQTMarlem
I cannot say about the issue for accessibility. But (unless guides say otherwise) I would always suggest stylesheet as this can be altered at any time, especially if you put your stylesheet rules into external files. I can only imagine that might be useful in your situation. UsingQFont
will mean the code is compiled with the value of the size, cannot be changed at runtime. -
Thank you for your reply.
Alright, I'll use style sheets. That's fine with me too. -
Hi,
People with visual impairments usually have their OS adjusted to their issue so I would not hardcode sizes in an application for that purpose as you might do a disservice to the community you want to support.