@Sammasas
I didn't find a universal way, but with an QJNIObject and objective c it works now. Java with JNiObject:
It's important that the file is under src/mypackage.
.cpp file:
#ifdef Q_OS_ANDROID QJniObject context = QNativeInterface::QAndroidApplication::context(); if(QJniObject::isClassAvailable("Klingelball/AndroidSettings")) { QJniObject androidSettingsJavaObject = QJniObject("Klingelball/AndroidSettings"); fontScale = new float(androidSettingsJavaObject.callStaticMethod<jfloat>("Klingelball/AndroidSettings", "getFontScale", "(Landroid/content/Context;)F", context.object<jobject>())); qDebug() <<"Font scale:" << *fontScale; setup_fontAndroid(*fontScale); } else { qDebug() << "JAVA CLASS UNAVAIABLE!"; fontScale = new float(1); setup_fontAndroid(*fontScale); } #endifiOs with objective-c:
.mm file:
.h file:
class iOSSettings { public: static int getPrefferedFont(); };.cpp file:
#ifdef Q_OS_IOS fontScale = new float(getfontScalefrompointSize(iOSSettings::getPrefferedFont())); setup_fontiOS(iOSSettings::getPrefferedFont()); #endifiOS returns the preffered Fontsize, I implemented a function that returns a factor based on the fontsize because I had to scale the Icons too.
Hope this helps somebody :)