1. Android default font is droidsansfallback: Google Chinese font
Due to inconsistent phone and PC fonts, the app developed on the PC is displayed as a small box in Chinese to the destination Android device.
Therefore, you need to set the system font in the main function of QT:
// Pass the font file name to Addapplicationfont to get the font ID int Fontid = Qfontdatabase::addapplicationfont ("/system/fonts/droidsansfallback.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,ten); App.setfont (font);
2. In order to facilitate debugging in the development environment, you can download Droidsansfallback fonts and install them into the development host, and choose font changes in the qtcreator environment.
Realize the font display effect of the development machine consistent with the target machine.
Qt Development Android app's Chinese font problem