diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 18:58:48 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-09-10 18:58:48 (GMT) |
commit | 0551521be2df929089f892dacce5bd64bc99096d (patch) | |
tree | 80ce18b7a620df94c2271beedb974271561bfba7 /src/gui/widgets/qtoolbar.cpp | |
parent | 3dc18b19ee2a02b93cc509a9162bf0a3900c6fd0 (diff) | |
parent | e26cba5c15ae02ae0fba9b73ed90c9b1f7b5286b (diff) | |
download | Qt-0551521be2df929089f892dacce5bd64bc99096d.zip Qt-0551521be2df929089f892dacce5bd64bc99096d.tar.gz Qt-0551521be2df929089f892dacce5bd64bc99096d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-1:
Bearer management: Fix compilation with namespace.
fetch next token after class definition opening
delay next token fetching when opening namespace
don't let operator overloads confuse us
don't try to show source when no locations are given
Implement a private API for setting title widgets
Fix the bug for QSettings on Windows, to store qint32/quint32, qint64/quint64 in Windows registry.
fix CRLF
Added private API to install an x11EventFilter
NTLM code: Save domain in different variable
Update the error handling of invalid hostnames in QUrl.
Remove unsupported code from qobject.h for MSVC < .NET 2003
Properly implement qobject_cast for const pointers.
Revert "Doc: fixing page name bug caused by 07bbace404078dcfd82eff717daa97299b8ba52c changing qml elements page"
Diffstat (limited to 'src/gui/widgets/qtoolbar.cpp')
-rw-r--r-- | src/gui/widgets/qtoolbar.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/gui/widgets/qtoolbar.cpp b/src/gui/widgets/qtoolbar.cpp index 7ed27ea..316bb44 100644 --- a/src/gui/widgets/qtoolbar.cpp +++ b/src/gui/widgets/qtoolbar.cpp @@ -82,6 +82,9 @@ static void qt_mac_updateToolBarButtonHint(QWidget *parentWidget) } #endif +// qmainwindow.cpp +extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); + /****************************************************************************** ** QToolBarPrivate */ @@ -197,7 +200,7 @@ void QToolBarPrivate::initDrag(const QPoint &pos) QMainWindow *win = qobject_cast<QMainWindow*>(parent); Q_ASSERT(win != 0); - QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); + QMainWindowLayout *layout = qt_mainwindow_layout(win); Q_ASSERT(layout != 0); if (layout->pluggingWidget != 0) // the main window is animating a docking operation return; @@ -223,7 +226,7 @@ void QToolBarPrivate::startDrag(bool moving) QMainWindow *win = qobject_cast<QMainWindow*>(parent); Q_ASSERT(win != 0); - QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); + QMainWindowLayout *layout = qt_mainwindow_layout(win); Q_ASSERT(layout != 0); if (!moving) { @@ -247,8 +250,7 @@ void QToolBarPrivate::endDrag() q->releaseMouse(); if (state->dragging) { - QMainWindowLayout *layout = - qobject_cast<QMainWindowLayout *>(q->parentWidget()->layout()); + QMainWindowLayout *layout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(q->parentWidget())); Q_ASSERT(layout != 0); if (!layout->plug(state->widgetItem)) { @@ -340,7 +342,7 @@ bool QToolBarPrivate::mouseMoveEvent(QMouseEvent *event) if (win == 0) return true; - QMainWindowLayout *layout = qobject_cast<QMainWindowLayout*>(win->layout()); + QMainWindowLayout *layout = qt_mainwindow_layout(win); Q_ASSERT(layout != 0); if (layout->pluggingWidget == 0 @@ -588,7 +590,7 @@ QToolBar::~QToolBar() QMainWindow *mainwindow = qobject_cast<QMainWindow *>(parentWidget()); if (mainwindow) { #ifdef Q_WS_MAC - QMainWindowLayout *mainwin_layout = qobject_cast<QMainWindowLayout *>(mainwindow->layout()); + QMainWindowLayout *mainwin_layout = qt_mainwindow_layout(mainwindow); if (mainwin_layout && mainwin_layout->layoutState.toolBarAreaLayout.isEmpty() && mainwindow->testAttribute(Qt::WA_WState_Created)) macWindowToolbarShow(mainwindow, false); @@ -1135,7 +1137,7 @@ bool QToolBar::event(QEvent *event) if (toolbarInUnifiedToolBar(this)) { // I can static_cast because I did the qobject_cast in the if above, therefore // we must have a QMainWindowLayout here. - QMainWindowLayout *mwLayout = static_cast<QMainWindowLayout *>(parentWidget()->layout()); + QMainWindowLayout *mwLayout = qt_mainwindow_layout(qobject_cast<QMainWindow *>(parentWidget())); mwLayout->fixSizeInUnifiedToolbar(this); mwLayout->syncUnifiedToolbarVisibility(); } @@ -1289,6 +1291,8 @@ QWidget *QToolBar::widgetForAction(QAction *action) const return d->layout->itemAt(index)->widget(); } +extern QMainWindowLayout *qt_mainwindow_layout(const QMainWindow *window); + /*! \internal */ @@ -1315,7 +1319,7 @@ void QToolBar::initStyleOption(QStyleOptionToolBar *option) const if (!mainWindow) return; - QMainWindowLayout *layout = qobject_cast<QMainWindowLayout *>(mainWindow->layout()); + QMainWindowLayout *layout = qt_mainwindow_layout(mainWindow); Q_ASSERT_X(layout != 0, "QToolBar::initStyleOption()", "QMainWindow->layout() != QMainWindowLayout"); |