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

void QextMdiMainFrm::detachWindow ( QextMdiChildView pWnd,
bool  bShow = TRUE 
) [virtual, slot]

Makes a docked QextMdiChildView undocked. The view window still remains under the main frame's MDI control.

Definition at line 480 of file qextmdimainfrm.cpp.

References activateView(), QextMdiChildFrm::caption(), childViewIsDetachedNow(), defaultChildFrmSize(), QextMdiChildArea::destroyChildButNotItsView(), QextMdiChildArea::getCascadePoint(), QextMdiChildFrm::icon(), QextMdiChildView::isAttached(), mdiMode(), QextMdiChildView::mdiParent(), QextMdiChildView::setCaption(), QextMdiChildFrm::unsetClient(), and QextMdiChildView::youAreDetached().

Referenced by addWindow(), dockMenuItemActivated(), and removeWindowFromMdi().

{
   if (pWnd->isAttached()) {
      pWnd->removeEventFilter(this);
      pWnd->youAreDetached();
      // this is only if it was attached and you want to detach it
      if (pWnd->parent()) {
         QextMdiChildFrm *lpC=pWnd->mdiParent();
         if (lpC) {
            if (lpC->icon()) {
               QPixmap pixm(*(lpC->icon()));
               pWnd->setIcon(pixm);
            }
            QString capt(lpC->caption());
            if (!bShow)
               lpC->hide();
            lpC->unsetClient( m_undockPositioningOffset);
            m_pMdi->destroyChildButNotItsView(lpC,FALSE); //Do not focus the new top child , we loose focus...
            pWnd->setCaption(capt);
         }
      }
   }
   else {
      if (pWnd->size().isEmpty() || (pWnd->size() == QSize(1,1))) {
         if (m_pCurrentWindow) {
            pWnd->setGeometry( QRect( m_pMdi->getCascadePoint(m_pWinList->count()-1), m_pCurrentWindow->size()));
         }
         else {
            pWnd->setGeometry( QRect( m_pMdi->getCascadePoint(m_pWinList->count()-1), defaultChildFrmSize()));
         }
      }
#ifndef NO_KDE2
      if (mdiMode() == QextMdi::ToplevelMode) {
         XSetTransientForHint(qt_xdisplay(),pWnd->winId(),topLevelWidget()->winId());
      }
#endif

      return;
   }
#ifndef NO_KDE2
   if (mdiMode() == QextMdi::ToplevelMode) {
      XSetTransientForHint(qt_xdisplay(),pWnd->winId(),topLevelWidget()->winId());
   }
#endif

   // this will show it...
   if (bShow) {
      activateView(pWnd);
   }

   emit childViewIsDetachedNow(pWnd);
}


Generated by  Doxygen 1.6.0   Back to index