The default font under WIN10 is actually the Segoe UI, which causes different versions of Windows to appear inconsistent, so you can modify the default font for Windows (which takes effect after a reboot):
[hkey_local_machine>>software>>microsoft>>windowsnt>>currentversion>> Fontsubstitutes:segoe UI = Tahoma]
However, it is best to specify the display font for the software itself so that it can be controlled so that the global font is set:
Qfont font;font.setfamily ("MS Shell Dlg 2"// Tahoma Arial qapp- >setfont (font);
To detect a global font:
Qdebug () << qapp-><< qapp-><< qapp-><< qapp-> << qapp-><< qapp->font (). key ();
Output Result:
"Unknown"
"MS Shell DLG 2"
"Arial"
""
"MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0"
"MS Shell Dlg 2,8.25,-1,5,50,0,0,0,0,0"
---------------------------------------------------------------------
In addition, the font can be taken as a resource file, and then used, for example, I think Microsoft Black is good:
Pass the font file name to Addapplicationfont to get the font ID
int fontid = Qfontdatabase::addapplicationfont ("./res/msyh.ttf");
Pass the font ID to applicationfontfamilies and get a qstringlist, where the first element is the newly added font family
QString msyh = qfontdatabase::applicationfontfamilies (Fontid). at (0);
Qfont font (msyh,10);
Set this font to the default font for Qapplication
Qapplication::setfont (font);
---------------------------------------------------------------------
Qfont provides font for drawing text
Qfontcombobox provides a drop-down list box for selecting font families
Qfontdatabase provides fonts that can be used under the Windows operating system
Qfontdialog is used to select a specified font
Qfontengineinfo is used to describe a specified font engine plug-in
Qfontengineplugin tired provides the base of the font warehouse plug-in for embedded Linux
Qfontinfo contains general information about a font
Qfontdialog used to pop up a dialog box to get the specified font
---------------------------------------------------------------------
Reference:
Http://mobile.51cto.com/symbian-272552.htm (there is also a series of articles below)
http://blog.csdn.net/Liuqz2009/article/details/7208637
Qt's default font is actually MS Shell DLG 2