diff options
-rw-r--r-- | src/plugins/platforms/ios/qiostheme.h | 3 | ||||
-rw-r--r-- | src/plugins/platforms/ios/qiostheme.mm | 6 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiostheme.h b/src/plugins/platforms/ios/qiostheme.h index 400637eca1..b457151b1c 100644 --- a/src/plugins/platforms/ios/qiostheme.h +++ b/src/plugins/platforms/ios/qiostheme.h @@ -44,6 +44,8 @@ #include <QtGui/QPalette> #include <qpa/qplatformtheme.h> +#include <QtCore/private/qcore_mac_p.h> + QT_BEGIN_NAMESPACE class QIOSTheme : public QPlatformTheme @@ -71,6 +73,7 @@ public: private: static QPalette s_systemPalette; + QMacNotificationObserver m_contentSizeCategoryObserver; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/ios/qiostheme.mm b/src/plugins/platforms/ios/qiostheme.mm index 69416ec24a..588cf3f22d 100644 --- a/src/plugins/platforms/ios/qiostheme.mm +++ b/src/plugins/platforms/ios/qiostheme.mm @@ -66,6 +66,12 @@ const char *QIOSTheme::name = "ios"; QIOSTheme::QIOSTheme() { initializeSystemPalette(); + + m_contentSizeCategoryObserver = QMacNotificationObserver(nil, + UIContentSizeCategoryDidChangeNotification, [] { + qCDebug(lcQpaFonts) << "Contents size category changed to" << UIApplication.sharedApplication.preferredContentSizeCategory; + QPlatformFontDatabase::handleAvailableFontsChanged(); + }); } QIOSTheme::~QIOSTheme() |