summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index 594ad65a18..75a33cbda3 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -87,7 +87,9 @@ static NSButton *macCreateButton(const char *text, NSView *superview)
- (void)finishOffWithCode:(NSInteger)code;
@end
-@implementation QT_MANGLE_NAMESPACE(QNSColorPanelDelegate)
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
+
+@implementation QNSColorPanelDelegate
- (id)initWithDialogHelper:(QCocoaColorDialogHelper *)helper
{
@@ -296,9 +298,9 @@ static NSButton *macCreateButton(const char *text, NSView *superview)
return (mResultCode == NSOKButton);
}
-- (QT_PREPEND_NAMESPACE(QPlatformDialogHelper::DialogCode))dialogResultCode
+- (QPlatformDialogHelper::DialogCode)dialogResultCode
{
- return (mResultCode == NSOKButton) ? QT_PREPEND_NAMESPACE(QPlatformDialogHelper::Accepted) : QT_PREPEND_NAMESPACE(QPlatformDialogHelper::Rejected);
+ return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
}
- (BOOL)windowShouldClose:(id)window
@@ -354,7 +356,7 @@ QCocoaColorDialogHelper::~QCocoaColorDialogHelper()
{
if (!mDelegate)
return;
- [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate) release];
+ [reinterpret_cast<QNSColorPanelDelegate *>(mDelegate) release];
mDelegate = 0;
}
@@ -364,7 +366,7 @@ void QCocoaColorDialogHelper::exec()
// QEventLoop has been interrupted, and the second-most event loop has not
// yet been reactivated (regardless if [NSApp run] is still on the stack)),
// showing a native modal dialog will fail.
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
+ QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
if ([delegate runApplicationModalPanel])
emit accept();
else
@@ -382,14 +384,14 @@ void QCocoaColorDialogHelper::hide()
{
if (!mDelegate)
return;
- [reinterpret_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate)->mColorPanel close];
+ [reinterpret_cast<QNSColorPanelDelegate *>(mDelegate)->mColorPanel close];
}
void QCocoaColorDialogHelper::setCurrentColor(const QColor &color)
{
if (!mDelegate)
createNSColorPanelDelegate();
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
+ QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
// make sure that if ShowAlphaChannel option is set then also setShowsAlpha
// needs to be set, otherwise alpha value is omitted
@@ -417,7 +419,7 @@ QColor QCocoaColorDialogHelper::currentColor() const
{
if (!mDelegate)
return QColor();
- return reinterpret_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate)->mQtColor;
+ return reinterpret_cast<QNSColorPanelDelegate *>(mDelegate)->mQtColor;
}
void QCocoaColorDialogHelper::createNSColorPanelDelegate()
@@ -425,7 +427,7 @@ void QCocoaColorDialogHelper::createNSColorPanelDelegate()
if (mDelegate)
return;
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = [[QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) alloc]
+ QNSColorPanelDelegate *delegate = [[QNSColorPanelDelegate alloc]
initWithDialogHelper:this];
mDelegate = delegate;
@@ -435,7 +437,7 @@ bool QCocoaColorDialogHelper::showCocoaColorPanel(Qt::WindowModality windowModal
{
Q_UNUSED(parent);
createNSColorPanelDelegate();
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
+ QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
[delegate->mColorPanel setShowsAlpha:options()->testOption(QColorDialogOptions::ShowAlphaChannel)];
if (windowModality != Qt::WindowModal)
[delegate showModelessPanel];
@@ -448,7 +450,7 @@ bool QCocoaColorDialogHelper::hideCocoaColorPanel()
if (!mDelegate){
return false;
} else {
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *>(mDelegate);
+ QNSColorPanelDelegate *delegate = static_cast<QNSColorPanelDelegate *>(mDelegate);
[delegate closePanel];
return true;
}