src/gui/widgets/qmainwindowlayout.cpp
branchRCL_3
changeset 7 3f74d0d4af4c
parent 4 3b1da2848fc7
equal deleted inserted replaced
6:dee5afe5301f 7:3f74d0d4af4c
  1625 #ifndef QT_NO_TOOLBAR
  1625 #ifndef QT_NO_TOOLBAR
  1626         if (QToolBar *tb = qobject_cast<QToolBar*>(widget))
  1626         if (QToolBar *tb = qobject_cast<QToolBar*>(widget))
  1627             tb->d_func()->plug(currentGapRect);
  1627             tb->d_func()->plug(currentGapRect);
  1628 #endif
  1628 #endif
  1629 
  1629 
       
  1630         savedState.clear();
       
  1631         currentGapPos.clear();
       
  1632         pluggingWidget = 0;
       
  1633         //applying the state will make sure that the currentGap is updated correctly
       
  1634         //and all the geometries (especially the one from the central widget) is correct
       
  1635         layoutState.apply(false);
       
  1636 
  1630 #ifndef QT_NO_DOCKWIDGET
  1637 #ifndef QT_NO_DOCKWIDGET
  1631 #ifndef QT_NO_TABBAR
  1638 #ifndef QT_NO_TABBAR
  1632         if (qobject_cast<QDockWidget*>(widget) != 0) {
  1639         if (qobject_cast<QDockWidget*>(widget) != 0) {
  1633             // info() might return null if the widget is destroyed while
  1640             // info() might return null if the widget is destroyed while
  1634             // animating but before the animationFinished signal is received.
  1641             // animating but before the animationFinished signal is received.
  1635             if (QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(widget))
  1642             if (QDockAreaLayoutInfo *info = layoutState.dockAreaLayout.info(widget))
  1636                 info->setCurrentTab(widget);
  1643                 info->setCurrentTab(widget);
  1637         }
  1644         }
  1638 #endif
  1645 #endif
  1639 #endif
  1646 #endif
  1640 
       
  1641         savedState.clear();
       
  1642         currentGapPos.clear();
       
  1643         pluggingWidget = 0;
       
  1644         //applying the state will make sure that the currentGap is updated correctly
       
  1645         //and all the geometries (especially the one from the central widget) is correct
       
  1646         layoutState.apply(false);
       
  1647     }
  1647     }
  1648 
  1648 
  1649     if (!widgetAnimator.animating()) {
  1649     if (!widgetAnimator.animating()) {
  1650         //all animations are finished
  1650         //all animations are finished
  1651 #ifndef QT_NO_DOCKWIDGET
  1651 #ifndef QT_NO_DOCKWIDGET
  1770         addChildWidget(widget);
  1770         addChildWidget(widget);
  1771     layoutState.setCentralWidget(widget);
  1771     layoutState.setCentralWidget(widget);
  1772     if (savedState.isValid()) {
  1772     if (savedState.isValid()) {
  1773 #ifndef QT_NO_DOCKWIDGET
  1773 #ifndef QT_NO_DOCKWIDGET
  1774         savedState.dockAreaLayout.centralWidgetItem = layoutState.dockAreaLayout.centralWidgetItem;
  1774         savedState.dockAreaLayout.centralWidgetItem = layoutState.dockAreaLayout.centralWidgetItem;
       
  1775         savedState.dockAreaLayout.fallbackToSizeHints = true;
  1775 #else
  1776 #else
  1776         savedState.centralWidgetItem = layoutState.centralWidgetItem;
  1777         savedState.centralWidgetItem = layoutState.centralWidgetItem;
  1777 #endif
  1778 #endif
  1778     }
  1779     }
  1779     invalidate();
  1780     invalidate();