]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
*** empty log message ***
authorstv <stv@opencascade.com>
Fri, 13 Jul 2007 12:25:05 +0000 (12:25 +0000)
committerstv <stv@opencascade.com>
Fri, 13 Jul 2007 12:25:05 +0000 (12:25 +0000)
src/SUIT/SUIT_Desktop.cxx

index e16680033bbfdf8042644303440ffd5465e42341..65fda831478d54d755cfd43f27d469e5b3886ae8 100755 (executable)
@@ -24,8 +24,9 @@
 #include <QtxActionMenuMgr.h>
 #include <QtxActionToolMgr.h>
 
-#include <QApplication>
+#include <QPointer>
 #include <QCloseEvent>
+#include <QApplication>
 
 /*!\class SUIT_Desktop
  * Provide desktop management:\n
@@ -42,7 +43,7 @@ public:
   QObject* object() const { return myObj; }
 
 private:
-  QObject* myObj;
+  QPointer<QObject> myObj;
 };
 
 /*!
@@ -101,7 +102,7 @@ void SUIT_Desktop::closeEvent( QCloseEvent* e )
 void SUIT_Desktop::childEvent( QChildEvent* e )
 {
   if ( e->type() == QEvent::ChildAdded && e->child()->isWidgetType() )
-    QApplication::postEvent( this, new QChildEvent( QEvent::Type( Reparent ), e->child() ) );
+    QApplication::postEvent( this, new ReparentEvent( QEvent::Type( Reparent ), e->child() ) );
   else
     QtxMainWindow::childEvent( e );
 }
@@ -111,10 +112,10 @@ void SUIT_Desktop::customEvent( QEvent* e )
   if ( (int)e->type() != Reparent )
     return;
 
-  QChildEvent* re = (QChildEvent*)e;
-  if ( re->child()->inherits( "SUIT_ViewWindow" ) )
+  ReparentEvent* re = (ReparentEvent*)e;
+  SUIT_ViewWindow* wid = ::qobject_cast<SUIT_ViewWindow*>( re->object() );
+  if ( wid )
   {
-    QWidget* wid = (QWidget*)re->child();
     bool invis = wid->testAttribute( Qt::WA_WState_ExplicitShowHide ) &&
                  wid->testAttribute( Qt::WA_WState_Hidden );