Changeset 846 for trunk/src/gui/widgets/qtoolbar.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/widgets/qtoolbar.cpp
r769 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 83 83 #endif 84 84 85 // qmainwindow.cpp 86 extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); 87 85 88 /****************************************************************************** 86 89 ** QToolBarPrivate … … 198 201 QMainWindow *win = qobject_cast<QMainWindow*>(parent); 199 202 Q_ASSERT(win != 0); 200 QMainWindowLayout *layout = q object_cast<QMainWindowLayout*>(win->layout());203 QMainWindowLayout *layout = qt_mainwindow_layout(win); 201 204 Q_ASSERT(layout != 0); 202 205 if (layout->pluggingWidget != 0) // the main window is animating a docking operation … … 224 227 QMainWindow *win = qobject_cast<QMainWindow*>(parent); 225 228 Q_ASSERT(win != 0); 226 QMainWindowLayout *layout = q object_cast<QMainWindowLayout*>(win->layout());229 QMainWindowLayout *layout = qt_mainwindow_layout(win); 227 230 Q_ASSERT(layout != 0); 228 231 … … 248 251 249 252 if (state->dragging) { 250 QMainWindowLayout *layout = 251 qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout()); 253 QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget())); 252 254 Q_ASSERT(layout != 0); 253 255 … … 341 343 return true; 342 344 343 QMainWindowLayout *layout = q object_cast<QMainWindowLayout*>(win->layout());345 QMainWindowLayout *layout = qt_mainwindow_layout(win); 344 346 Q_ASSERT(layout != 0); 345 347 … … 534 536 535 537 /*! 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 /*! 536 546 Constructs a QToolBar with the given \a parent. 537 547 */ … … 581 591 if (mainwindow) { 582 592 #ifdef Q_WS_MAC 583 QMainWindowLayout *mainwin_layout = q object_cast<QMainWindowLayout *>(mainwindow->layout());593 QMainWindowLayout *mainwin_layout = qt_mainwindow_layout(mainwindow); 584 594 if (mainwin_layout && mainwin_layout->layoutState.toolBarAreaLayout.isEmpty() 585 595 && mainwindow->testAttribute(Qt::WA_WState_Created)) … … 1123 1133 case QEvent::Show: 1124 1134 d->toggleViewAction->setChecked(event->type() == QEvent::Show); 1135 emit visibilityChanged(event->type() == QEvent::Show); 1125 1136 #if defined(Q_WS_MAC) 1126 1137 if (toolbarInUnifiedToolBar(this)) { 1127 1138 // I can static_cast because I did the qobject_cast in the if above, therefore 1128 1139 // we must have a QMainWindowLayout here. 1129 QMainWindowLayout *mwLayout = static_cast<QMainWindowLayout *>(parentWidget()->layout());1140 QMainWindowLayout *mwLayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(parentWidget())); 1130 1141 mwLayout->fixSizeInUnifiedToolbar(this); 1131 1142 mwLayout->syncUnifiedToolbarVisibility(); … … 1281 1292 } 1282 1293 1294 extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); 1295 1283 1296 /*! 1284 1297 \internal … … 1307 1320 return; 1308 1321 1309 QMainWindowLayout *layout = q object_cast<QMainWindowLayout *>(mainWindow->layout());1322 QMainWindowLayout *layout = qt_mainwindow_layout(mainWindow); 1310 1323 Q_ASSERT_X(layout != 0, "QToolBar::initStyleOption()", 1311 1324 "QMainWindow->layout() != QMainWindowLayout");
Note:
See TracChangeset
for help on using the changeset viewer.