Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
app.setFont not work in static build Qt
MohsenNz last edited by MohsenNz
I defined my font in .qrc resources . I wanted to set a default font for my app.
I am developing a qtqucik application.
when I build my app normally (in qtqreator) it's work fine.
but when build my app statically , it don't recognize the font.
bellow is my code:
int id = QFontDatabase::addApplicationFont(":/Fonts/Ubuntu-R.ttf"); QString family = QFontDatabase::applicationFontFamilies(id).at(0); QFont ubuntuFont(family); app.setFont(ubuntuFont);
You should read what needs to be done with resources when using static linking: http://doc.qt.io/qt-5/resources.html#using-resources-in-the-application