Unsolved How to change different fonts when change to different language.
-
I have 4 fonts:
When UI language is English, use
font1.ttf
font2.ttf
When language is Chinese, Use:
font3.ttf
font4.ttfHow to do this? Thanks
-
After calling
QApplication::installTranslator
callQApplication::setFont
-
@VRonin Thanks, but I have 2 different ttf fonts each Language, app.setFont(xxx) only change the default font.
For example:
All title use bold.ttf,
others use regular.ttf -
There's no such a thing as a generic "title". What widgets are you using?
-
@VRonin Sorry for not clearly expressed.
For example:- English Language:
QTabBar{font:"Font1_English"}
Default text {font:"Font2_English"}
2)Chinese:
Change QTabBar{font:"Font1_CN"}
Default {font:"Font2_CN"} - English Language:
-
Hi,
Are you using style sheet for that ?
-
@SGaist said in How to change different fonts when change to different language.:
Yes SGaist
-
Then when the change language event happens, change the style sheet.