Cocoa: Remove QtWidgets dependencies.
authorMorten Johan Sorvig <morten.sorvig@nokia.com>
Fri, 8 Jun 2012 10:55:55 +0000 (12:55 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 11 Jun 2012 09:21:37 +0000 (11:21 +0200)
Make the file/color dialog helpers use QCoreApplication::
translate("QDialogButtonBox", text) instead of
QDialogButtonBox::tr(text)

Change-Id: I7ee4c32f8f8b9cd002836e24b962ef1c0f2e0737
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm

index d617d1d..44b022c 100644 (file)
@@ -45,8 +45,6 @@
 
 #include <QtCore/qdebug.h>
 #include <QtCore/qtimer.h>
-#include <QtWidgets/qdialogbuttonbox.h>
-#include <QtWidgets/qcolordialog.h>
 
 #include "qcocoahelpers.h"
 
@@ -61,7 +59,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview)
     NSButton *button = [[NSButton alloc] initWithFrame:buttonFrameRect];
     [button setButtonType:NSMomentaryLightButton];
     [button setBezelStyle:NSRoundedBezelStyle];
-    [button setTitle:(NSString*)(CFStringRef)QCFString(QDialogButtonBox::tr(text)
+    [button setTitle:(NSString*)(CFStringRef)QCFString(QCoreApplication::translate("QDialogButtonBox", text)
                                                        .remove(QLatin1Char('&')))];
     [[button cell] setFont:[NSFont systemFontOfSize:
             [NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
index 088f626..141e0db 100644 (file)
@@ -45,8 +45,6 @@
 
 #include <QtCore/qtimer.h>
 #include <QtGui/qfontdatabase.h>
-#include <QtWidgets/qdialogbuttonbox.h>
-#include <QtWidgets/qfontdialog.h>
 
 #include <private/qfont_p.h>
 #include <private/qfontengine_p.h>
@@ -81,7 +79,7 @@ static NSButton *macCreateButton(const char *text, NSView *superview)
     NSButton *button = [[NSButton alloc] initWithFrame:buttonFrameRect];
     [button setButtonType:NSMomentaryLightButton];
     [button setBezelStyle:NSRoundedBezelStyle];
-    [button setTitle:(NSString*)(CFStringRef)QCFString(QDialogButtonBox::tr(text)
+    [button setTitle:(NSString*)(CFStringRef)QCFString(QCoreApplication::translate("QDialogButtonBox", text)
                                                        .remove(QLatin1Char('&')))];
     [[button cell] setFont:[NSFont systemFontOfSize:
             [NSFont systemFontSizeForControlSize:NSRegularControlSize]]];