Load Mac specific resources when used in a static build
authorAndy Shaw <andy.shaw@digia.com>
Mon, 27 Aug 2012 12:03:47 +0000 (14:03 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 20 Sep 2012 05:01:42 +0000 (07:01 +0200)
When Qt was built statically then the Mac specific resources were not
being loaded which meant some style specific images were not used.

Task-number: QTBUG-25391
Change-Id: If311148df19a87b6c8104553b662e3bf157f5717
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/plugins/platforms/cocoa/qcocoaintegration.mm

index dfb1151..81d20e9 100644 (file)
 
 #include <QtPlatformSupport/private/qcoretextfontdatabase_p.h>
 
+static void initResources()
+{
+    Q_INIT_RESOURCE_EXTERN(qcocoaresources)
+    Q_INIT_RESOURCE(qcocoaresources);
+}
+
 QT_BEGIN_NAMESPACE
 
 QCocoaScreen::QCocoaScreen(int screenIndex)
@@ -159,6 +165,7 @@ QCocoaIntegration::QCocoaIntegration()
     , mNativeInterface(new QCocoaNativeInterface)
     , mServices(new QCocoaServices)
 {
+    initResources();
     QCocoaAutoReleasePool pool;
 
     qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false);