equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
470 } |
470 } |
471 } |
471 } |
472 |
472 |
473 void QMainWindowLayout::cleanUpMacToolbarItems() |
473 void QMainWindowLayout::cleanUpMacToolbarItems() |
474 { |
474 { |
475 for (int i = 0; i < toolbarItemsCopy.size(); ++i) |
475 #ifdef QT_MAC_USE_COCOA |
|
476 QMacCocoaAutoReleasePool pool; |
|
477 #endif |
|
478 for (int i = 0; i < toolbarItemsCopy.size(); ++i) { |
|
479 #ifdef QT_MAC_USE_COCOA |
|
480 NSToolbarItem *item = static_cast<NSToolbarItem *>(toolbarItemsCopy.at(i)); |
|
481 [item setView:0]; |
|
482 #endif |
476 CFRelease(toolbarItemsCopy.at(i)); |
483 CFRelease(toolbarItemsCopy.at(i)); |
|
484 } |
477 toolbarItemsCopy.clear(); |
485 toolbarItemsCopy.clear(); |
478 unifiedToolbarHash.clear(); |
486 unifiedToolbarHash.clear(); |
|
487 |
|
488 #ifdef QT_MAC_USE_COCOA |
|
489 OSWindowRef window = qt_mac_window_for(layoutState.mainWindow); |
|
490 NSToolbar *macToolbar = [window toolbar]; |
|
491 if (macToolbar) { |
|
492 [[macToolbar delegate] release]; |
|
493 [macToolbar setDelegate:nil]; |
|
494 } |
|
495 #endif |
479 } |
496 } |
480 |
497 |
481 void QMainWindowLayout::fixSizeInUnifiedToolbar(QToolBar *tb) const |
498 void QMainWindowLayout::fixSizeInUnifiedToolbar(QToolBar *tb) const |
482 { |
499 { |
483 #ifdef QT_MAC_USE_COCOA |
500 #ifdef QT_MAC_USE_COCOA |