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

bool QextMdiMainFrm::event ( QEvent *  e  )  [virtual]

Catches certain Qt events and processes it here. Currently, here this catches only the QextMdiViewCloseEvent (a QextMDI user event) which is sent from itself in childWindowCloseRequest() right after a QextMdiChildView::closeEvent() . The reason for this event to itself is simple: It just wants to break the function call stack. It continues the processing with calling closeWindow() . You see, a close() is translated to a closeWindow() . It is necessary that the main frame has to start an MDI view close action because it must remove the MDI view from MDI control, additionally.

This method calls QMainWindow::event , additionally.

Reimplemented in KBear.

Definition at line 806 of file qextmdimainfrm.cpp.

References closeWindow().

Referenced by KBear::event().

   if( e->type() == QEvent::User) {
      QextMdiChildView* pWnd = (QextMdiChildView*)((QextMdiViewCloseEvent*)e)->data();
      if( pWnd != 0L)
         closeWindow( pWnd);
      return TRUE;
   // A hack little hack: If MDI child views are moved implicietly by moving 
   // the main widget the should know this too. Unfortunately there seems to
   // be no way to catch the move start / move stop situations for the main
   // widget in a clean way. (There is no MouseButtonPress/Release or 
   // something like that.) Therefore we do the following: When we get the 
   // "first" move event we start a timer and interprete it as "drag begin".
   // If we get the next move event and the timer is running we restart the 
   // timer and don't do anything else. If the timer elapses (this meens we
   // haven't had any move event for a while) we interprete this as "drag
   // end". If the moving didn't stop actually, we will later get another
   // "drag begin", so we get a drag end too much, but this would be the same
   // as if the user would stop moving for a little while.
   // Actually we seem to be lucky that the timer does not elapse while we
   // are moving -> so we have no obsolete drag end / begin
   else if( isVisible() && (e->type() == QEvent::Move)) {
      if (m_pDragEndTimer->isActive()) {
         // this is not the first move -> stop old timer
      else {
         // this is the first move -> send the drag begin to all concerned views 
         QextMdiChildView* pView;
         for (m_pWinList->first(); (pView = m_pWinList->current()) != 0L; m_pWinList->next()) {
            QextMdiChildFrmDragBeginEvent    dragBeginEvent(0L);
            QApplication::sendEvent(pView, &dragBeginEvent);
      m_pDragEndTimer->start(200, true); // single shot after 200 ms

   return DockMainWindow::event( e);

Generated by  Doxygen 1.6.0   Back to index