Qt 4.8
Classes | Functions | Variables
qnspanelproxy_mac.mm File Reference
#include <qdialogbuttonbox.h>
#include <private/qt_mac_p.h>
#include <private/qcocoaintrospection_p.h>
#import <AppKit/AppKit.h>
#import <Foundation/Foundation.h>
#import <objc/objc-class.h>

Go to the source code of this file.

Classes

class  QNSPanelProxy
 
class  QNSWindowProxy
 

Functions

NSButton * macCreateButton (const char *text, NSView *superview)
 
void macStartInterceptNSPanelCtor ()
 
void macStartInterceptWindowTitle (QWidget *window)
 
void macStopInterceptNSPanelCtor ()
 
void macStopInterceptWindowTitle ()
 

Variables

static QWidgetcurrentWindow = 0
 

Function Documentation

◆ macCreateButton()

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

Definition at line 211 of file qnspanelproxy_mac.mm.

Referenced by QFontDialogPrivate::createNSFontPanelDelegate(), and 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

◆ macStartInterceptWindowTitle()

void macStartInterceptWindowTitle ( QWidget window)

Definition at line 185 of file qnspanelproxy_mac.mm.

Referenced by QPageSetupDialogPrivate::closeCarbonPageLayout(), and QPrintDialogPrivate::closeCarbonPrintPanel().

186 {
189  [NSWindow class],
190  @selector(setTitle:),
192  @selector(setTitle:),
193  @selector(qt_fakeSetTitle:));
194 }
static QWidget * currentWindow
NSWindow * window
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)

◆ macStopInterceptWindowTitle()

void macStopInterceptWindowTitle ( )

Definition at line 199 of file qnspanelproxy_mac.mm.

Referenced by QPageSetupDialogPrivate::closeCarbonPageLayout(), and QPrintDialogPrivate::closeCarbonPrintPanel().

200 {
201  currentWindow = 0;
203  [NSWindow class],
204  @selector(setTitle:),
205  @selector(qt_fakeSetTitle:));
206 }
static QWidget * currentWindow
void qt_cocoa_change_back_implementation(Class baseClass, SEL originalSel, SEL backupSel)

Variable Documentation

◆ currentWindow

QWidget* currentWindow = 0
static

Definition at line 51 of file qnspanelproxy_mac.mm.