src/gui/kernel/qt_cocoa_helpers_mac.mm
branchRCL_3
changeset 5 d3bac044e0f0
parent 4 3b1da2848fc7
child 8 3f74d0d4af4c
equal deleted inserted replaced
4:3b1da2848fc7 5:d3bac044e0f0
   141 extern QWidget * mac_mouse_grabber;
   141 extern QWidget * mac_mouse_grabber;
   142 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp
   142 extern QPointer<QWidget> qt_button_down; //qapplication_mac.cpp
   143 
   143 
   144 void macWindowFade(void * /*OSWindowRef*/ window, float durationSeconds)
   144 void macWindowFade(void * /*OSWindowRef*/ window, float durationSeconds)
   145 {
   145 {
       
   146 #ifdef QT_MAC_USE_COCOA
       
   147     QMacCocoaAutoReleasePool pool;
       
   148 #endif
   146     OSWindowRef wnd = static_cast<OSWindowRef>(window);
   149     OSWindowRef wnd = static_cast<OSWindowRef>(window);
   147     if (wnd) {
   150     if (wnd) {
   148         QWidget *widget;
   151         QWidget *widget;
   149 #if QT_MAC_USE_COCOA
   152 #if QT_MAC_USE_COCOA
   150         widget = [wnd QT_MANGLE_NAMESPACE(qt_qwidget)];
   153         widget = [wnd QT_MANGLE_NAMESPACE(qt_qwidget)];
  1276     QMacCocoaAutoReleasePool pool;
  1279     QMacCocoaAutoReleasePool pool;
  1277     [static_cast<NSCursor *>(qt_mac_nsCursorForQCursor(cursor)) set];
  1280     [static_cast<NSCursor *>(qt_mac_nsCursorForQCursor(cursor)) set];
  1278 }
  1281 }
  1279 #endif
  1282 #endif
  1280 
  1283 
       
  1284 QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool()
       
  1285 {
       
  1286 #ifndef QT_MAC_USE_COCOA
       
  1287     NSApplicationLoad();
       
  1288 #endif
       
  1289     pool = (void*)[[NSAutoreleasePool alloc] init];
       
  1290 }
       
  1291 
       
  1292 QMacCocoaAutoReleasePool::~QMacCocoaAutoReleasePool()
       
  1293 {
       
  1294     [(NSAutoreleasePool*)pool release];
       
  1295 }
       
  1296 
  1281 QT_END_NAMESPACE
  1297 QT_END_NAMESPACE