Unsolved How do I change the font family in Qt android app
-
When I work in code yes it does changes but when i run the app it comes to the default same font, how how can i change in app too!
-
QGuiApplication has a
QGuiApplication::setFont(const QFont &font)
to change the default font of your application. You can call it inside your main.cpp to set the font-family to what you want.However you should select a font-family that is guaranteed to be part of the andoidOS or you'll have to ship your own font with the application.
-
@J.Hilk Nope it didn't work what if i wanted to change one of my particular heading of one page the font doesn't change .
-
@Vineela
keep in mind, that, when you change the font of your items, via StyleSheet, QGuiApplication::setFont(const QFont &font) will have no effect on this items. -
@J.Hilk So if i wont give via StyleSheet will this QGuiApplication::setFont(const QFont &font) be effective?
-
@Vineela as far as I know, yes.
if you set the font somewhere from your quellcode, via StyleSheet or object->setFont(), then the default font won't have any effect on that object.