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/qtoolbar.cpp

    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)
     
    8383#endif
    8484
     85// qmainwindow.cpp
     86extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
     87
    8588/******************************************************************************
    8689** QToolBarPrivate
     
    198201    QMainWindow *win = qobject_cast<QMainWindow*>(parent);
    199202    Q_ASSERT(win != 0);
    200     QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout());
     203    QMainWindowLayout *layout = qt_mainwindow_layout(win);
    201204    Q_ASSERT(layout != 0);
    202205    if (layout->pluggingWidget != 0) // the main window is animating a docking operation
     
    224227    QMainWindow *win = qobject_cast<QMainWindow*>(parent);
    225228    Q_ASSERT(win != 0);
    226     QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout());
     229    QMainWindowLayout *layout = qt_mainwindow_layout(win);
    227230    Q_ASSERT(layout != 0);
    228231
     
    248251
    249252    if (state->dragging) {
    250         QMainWindowLayout *layout =
    251             qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout());
     253        QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget()));
    252254        Q_ASSERT(layout != 0);
    253255
     
    341343        return true;
    342344
    343     QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout());
     345    QMainWindowLayout *layout = qt_mainwindow_layout(win);
    344346    Q_ASSERT(layout != 0);
    345347
     
    534536
    535537/*!
     538    \fn void QToolBar::visibilityChanged(bool visible)
     539    \since 4.7
     540
     541    This signal is emitted when the toolbar becomes \a visible (or
     542    invisible). This happens when the widget is hidden or shown.
     543*/
     544
     545/*!
    536546    Constructs a QToolBar with the given \a parent.
    537547*/
     
    581591    if (mainwindow) {
    582592#ifdef Q_WS_MAC
    583         QMainWindowLayout *mainwin_layout = qobject_cast<QMainWindowLayout *>(mainwindow->layout());
     593        QMainWindowLayout *mainwin_layout = qt_mainwindow_layout(mainwindow);
    584594        if (mainwin_layout && mainwin_layout->layoutState.toolBarAreaLayout.isEmpty()
    585595                && mainwindow->testAttribute(Qt::WA_WState_Created))
     
    11231133    case QEvent::Show:
    11241134        d->toggleViewAction->setChecked(event->type() == QEvent::Show);
     1135        emit visibilityChanged(event->type() == QEvent::Show);
    11251136#if defined(Q_WS_MAC)
    11261137        if (toolbarInUnifiedToolBar(this)) {
    11271138             // I can static_cast because I did the qobject_cast in the if above, therefore
    11281139            // we must have a QMainWindowLayout here.
    1129             QMainWindowLayout *mwLayout = static_cast<QMainWindowLayout *>(parentWidget()->layout());
     1140            QMainWindowLayout *mwLayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(parentWidget()));
    11301141            mwLayout->fixSizeInUnifiedToolbar(this);
    11311142            mwLayout->syncUnifiedToolbarVisibility();
     
    12811292}
    12821293
     1294extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window);
     1295
    12831296/*!
    12841297    \internal
     
    13071320        return;
    13081321
    1309     QMainWindowLayout *layout = qobject_cast<QMainWindowLayout *>(mainWindow->layout());
     1322    QMainWindowLayout *layout = qt_mainwindow_layout(mainWindow);
    13101323    Q_ASSERT_X(layout != 0, "QToolBar::initStyleOption()",
    13111324               "QMainWindow->layout() != QMainWindowLayout");
Note: See TracChangeset for help on using the changeset viewer.