c++ - How I can dynamically change font in Qt application? -


i have qt 5.5 application lot of widgets. each widget has self font family draw text. of them defined in qss file, set directly qpainter.

application has localization languages. 1 of language should change font family widget dynamically (all widgets should have 1 font family) , revert changes other languages.

you can use qapplication::setfont() set default font multiple widgets @ once, can either use set default font everything, or set specific widget class, if pass class secont parameter. note can not used @ same time stylesheets.

if want set default font 1 specific widget, can use widget's setfont() function well. note if widget setting font have stylesheet attached, in case of conflicting properties values stylesheet used.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -