Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qmainwindowlayout_mac.mm

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    4949#else
    5050#include <private/qcocoatoolbardelegate_mac_p.h>
     51#import  <private/qcocoawindowdelegate_mac_p.h>
    5152#endif
    5253
     
    338339
    339340    layoutState.mainWindow->setUpdatesEnabled(false);  // reduces a little bit of flicker, not all though
     341#if defined(QT_MAC_USE_COCOA)
     342    QMacCocoaAutoReleasePool pool;
     343    NSView *cView = [qt_mac_window_for(layoutState.mainWindow) contentView];
     344    if (useMacToolbar) {
     345        [cView setPostsFrameChangedNotifications:YES];
     346        [[NSNotificationCenter defaultCenter] addObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate]
     347                                                 selector: @selector(syncContentViewFrame:)
     348                                                     name: NSViewFrameDidChangeNotification
     349                                                   object: cView];
     350    }
     351#endif
    340352    if (!useMacToolbar) {
    341353        macWindowToolbarShow(layoutState.mainWindow, false);
     
    357369        syncUnifiedToolbarVisibility();
    358370    }
     371#if defined(QT_MAC_USE_COCOA)
     372    if (!useMacToolbar) {
     373        [cView setPostsFrameChangedNotifications:NO];
     374        [[NSNotificationCenter defaultCenter] removeObserver: [QT_MANGLE_NAMESPACE(QCocoaWindowDelegate) sharedDelegate]
     375                                                        name: NSViewFrameDidChangeNotification
     376                                                      object: cView];
     377    }
     378#endif
    359379    layoutState.mainWindow->setUpdatesEnabled(true);
    360380}
     
    411431        [macToolbar setDisplayMode:NSToolbarDisplayModeIconOnly];
    412432        [macToolbar setSizeMode:NSToolbarSizeModeRegular];
    413         [macToolbar setDelegate:[[QCocoaToolBarDelegate alloc] initWithMainWindowLayout:this]];
     433        [macToolbar setDelegate:[[QT_MANGLE_NAMESPACE(QCocoaToolBarDelegate) alloc] initWithMainWindowLayout:this]];
    414434        [window setToolbar:macToolbar];
    415435        [macToolbar release];
Note: See TracChangeset for help on using the changeset viewer.