diff options
Diffstat (limited to 'src/plugins/platforms/uikit/quikitintegration.mm')
-rw-r--r-- | src/plugins/platforms/uikit/quikitintegration.mm | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/plugins/platforms/uikit/quikitintegration.mm b/src/plugins/platforms/uikit/quikitintegration.mm index 737fa40..21ab38f 100644 --- a/src/plugins/platforms/uikit/quikitintegration.mm +++ b/src/plugins/platforms/uikit/quikitintegration.mm @@ -44,6 +44,7 @@ #include "quikitwindowsurface.h" #include "quikitscreen.h" #include "quikiteventloop.h" +#include "qgenericunixfontdatabase.h" #include <QtGui/QApplication> @@ -55,7 +56,18 @@ QT_BEGIN_NAMESPACE +class QUIKitFontDatabase : public QGenericUnixFontDatabase +{ +public: + virtual QString fontDir() const + { + return QString( [[[[NSBundle mainBundle] bundlePath] + stringByAppendingPathComponent:@"fonts"] UTF8String] ); + } +}; + QUIKitIntegration::QUIKitIntegration() + :mFontDb(new QUIKitFontDatabase() ) { mScreens << new QUIKitScreen(0); } @@ -93,12 +105,7 @@ QPlatformEventLoopIntegration *QUIKitIntegration::createEventLoopIntegration() c QPlatformFontDatabase * QUIKitIntegration::fontDatabase() const { - static bool initialized = false; - if (!initialized) { - initialized = true; - setenv("QT_QPA_FONTDIR",[[[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"fonts"] UTF8String],1); - } - return QPlatformIntegration::fontDatabase(); + return mFontDb; } QT_END_NAMESPACE |