Qt 4.8
Classes | Typedefs | Functions
qcolordialog_mac.mm File Reference
#include "qcolordialog_p.h"
#include <qapplication.h>
#include <qtimer.h>
#include <qdialogbuttonbox.h>
#include <qabstracteventdispatcher.h>
#include <private/qapplication_p.h>
#include <private/qt_mac_p.h>
#include <qdebug.h>
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>

Go to the source code of this file.

Classes

protocol  <NSWindowDelegate >
 
class  QCocoaColorPanelDelegate
 

Typedefs

typedef float CGFloat
 

Functions

NSButton * macCreateButton (const char *text, NSView *superview)
 
void macStartInterceptNSPanelCtor ()
 
void macStopInterceptNSPanelCtor ()
 

Typedef Documentation

◆ CGFloat

typedef float CGFloat

Definition at line 55 of file qcolordialog_mac.mm.

Function Documentation

◆ macCreateButton()

NSButton* macCreateButton ( const char *  text,
NSView *  superview 
)

Definition at line 211 of file qnspanelproxy_mac.mm.

Referenced by QColorDialogPrivate::openCocoaColorPanel().

212 {
213  static const NSRect buttonFrameRect = { { 0.0, 0.0 }, { 0.0, 0.0 } };
214 
215  NSButton *button = [[NSButton alloc] initWithFrame:buttonFrameRect];
216  [button setButtonType:NSMomentaryLightButton];
217  [button setBezelStyle:NSRoundedBezelStyle];
218  [button setTitle:(NSString*)(CFStringRef)QCFString(QDialogButtonBox::tr(text)
219  .remove(QLatin1Char('&')))];
220  [[button cell] setFont:[NSFont systemFontOfSize:
221  [NSFont systemFontSizeForControlSize:NSRegularControlSize]]];
222  [superview addSubview:button];
223  return button;
224 }
const struct __CFString * CFStringRef
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
#define text
Definition: qobjectdefs.h:80

◆ macStartInterceptNSPanelCtor()

void macStartInterceptNSPanelCtor ( )

Definition at line 150 of file qnspanelproxy_mac.mm.

Referenced by QColorDialogPrivate::openCocoaColorPanel().

151 {
153  [NSPanel class],
154  @selector(initWithContentRect:styleMask:backing:defer:),
156  @selector(initWithContentRect:styleMask:backing:defer:),
157  @selector(qt_fakeInitWithContentRect:styleMask:backing:defer:));
159  [NSPanel class],
160  @selector(initWithContentRect:styleMask:backing:defer:screen:),
162  @selector(initWithContentRect:styleMask:backing:defer:screen:),
163  @selector(qt_fakeInitWithContentRect:styleMask:backing:defer:screen:));
164 }
void qt_cocoa_change_implementation(Class baseClass, SEL originalSel, Class proxyClass, SEL replacementSel, SEL backupSel)
#define QT_MANGLE_NAMESPACE(name)
Definition: qglobal.h:106

◆ macStopInterceptNSPanelCtor()

void macStopInterceptNSPanelCtor ( )

Definition at line 169 of file qnspanelproxy_mac.mm.

Referenced by QColorDialogPrivate::openCocoaColorPanel().

170 {
172  [NSPanel class],
173  @selector(initWithContentRect:styleMask:backing:defer:screen:),
174  @selector(qt_fakeInitWithContentRect:styleMask:backing:defer:screen:));
176  [NSPanel class],
177  @selector(initWithContentRect:styleMask:backing:defer:),
178  @selector(qt_fakeInitWithContentRect:styleMask:backing:defer:));
179 }
void qt_cocoa_change_back_implementation(Class baseClass, SEL originalSel, SEL backupSel)