#include <QtxActionMenuMgr.h>
#include <QtxActionToolMgr.h>
-#include <QApplication>
+#include <QPointer>
#include <QCloseEvent>
+#include <QApplication>
/*!\class SUIT_Desktop
* Provide desktop management:\n
QObject* object() const { return myObj; }
private:
- QObject* myObj;
+ QPointer<QObject> myObj;
};
/*!
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 );
}
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 );