Logo Search packages:      
Sourcecode: kbear version File versions  Download package

void QextMdiMainFrm::switchToChildframeMode (  )  [virtual, slot]

Docks all view windows (Windows-like)

docks all view windows (Windows-like)

Reimplemented in KBear.

Definition at line 1073 of file qextmdimainfrm.cpp.

References attachWindow(), findRootDockWidgets(), QextMdiChildView::isAttached(), QextMdiChildView::isToolView(), leftTopLevelMode(), and QextMdiChildView::show().

Referenced by attachWindow(), and KBear::switchToChildframeMode().

{
   if (m_mdiMode == QextMdi::ChildframeMode)
      return;

#if QT_VERSION < 300
   QList<KDockWidget> rootDockWidgetList;
#else
   QPtrList<KDockWidget> rootDockWidgetList;
#endif
   if (m_mdiMode == QextMdi::TabPageMode) {
      // select the dockwidgets to be undocked and store their geometry
      QValueList<QRect> positionList;
      findRootDockWidgets(&rootDockWidgetList, &positionList);

      // undock all these found oldest ancestors (being KDockWidgets)
#if QT_VERSION < 300
      QListIterator<KDockWidget> it3( rootDockWidgetList);
#else
      QPtrListIterator<KDockWidget> it3( rootDockWidgetList);
#endif
      for (; it3.current(); ++it3 ) {
          KDockWidget* pDockW = it3.current();
          pDockW->undock();
      }

      finishTabPageMode();
   }
   else if (m_mdiMode == QextMdi::ToplevelMode) {
      finishToplevelMode();
   }

   if (!m_pDockbaseAreaOfDocumentViews) {
      // cover QextMdi's childarea by a dockwidget
      m_pDockbaseAreaOfDocumentViews = createDockWidget( "mdiAreaCover", QPixmap(), 0L, "mdi_area_cover");
      m_pDockbaseAreaOfDocumentViews->setEnableDocking(KDockWidget::DockNone);
      m_pDockbaseAreaOfDocumentViews->setDockSite(KDockWidget::DockCorner);
      m_pDockbaseAreaOfDocumentViews->setWidget(m_pMdi);
   }
   if (m_pDockbaseAreaOfDocumentViews->isTopLevel()) {
      // set this dock to main view
      setView(m_pDockbaseAreaOfDocumentViews);
      setMainDockWidget(m_pDockbaseAreaOfDocumentViews);
      m_pDockbaseAreaOfDocumentViews->setEnableDocking(KDockWidget::DockNone);
      m_pDockbaseAreaOfDocumentViews->setDockSite(KDockWidget::DockCorner);
      m_pDockbaseOfTabPage = m_pDockbaseAreaOfDocumentViews;
   }
   m_pDockbaseAreaOfDocumentViews->show();
   if (m_mdiMode == QextMdi::TabPageMode) {
#if QT_VERSION < 300
      QListIterator<KDockWidget> it4( rootDockWidgetList);
#else
      QPtrListIterator<KDockWidget> it4( rootDockWidgetList);
#endif
      for (; it4.current(); ++it4 ) {
         KDockWidget* pDockW = it4.current();
         pDockW->dockBack();
      }
   }

   if (m_mdiMode == QextMdi::ToplevelMode && m_pTempDockSession) {
     // restore the old dock szenario which we memorized at the time we switched to toplevel mode
     QDomElement oldDockState = m_pTempDockSession->namedItem("cur_dock_state").toElement();
     readDockConfig( oldDockState);
   }

   QextMdi::MdiMode oldMdiMode = m_mdiMode;
   m_mdiMode = QextMdi::ChildframeMode;

#if QT_VERSION < 300
   QListIterator<QextMdiChildView> it( *m_pWinList);
#else
   QPtrListIterator<QextMdiChildView> it( *m_pWinList);
#endif
   for( ; it.current(); ++it) {
      QextMdiChildView* pView = it.current();
      if( !pView->isToolView())
         if( !pView->isAttached())
            attachWindow( pView, TRUE);
   }
   for( it.toFirst(); it.current(); ++it) {
      QextMdiChildView* pView = it.current();
      if( !pView->isToolView())
         pView->show();
   }
   if( (oldMdiMode == QextMdi::ToplevelMode) && !parentWidget()) {
      setMinimumHeight( m_oldMainFrmMinHeight);
      setMaximumHeight( m_oldMainFrmMaxHeight);
      resize( width(), m_oldMainFrmHeight);
      m_oldMainFrmHeight = 0;
      //qDebug("TopLevelMode off");
      emit leftTopLevelMode();
   }
}


Generated by  Doxygen 1.6.0   Back to index