From: stv Date: Wed, 16 Apr 2008 10:03:53 +0000 (+0000) Subject: IPAL19557 X-Git-Tag: V5_0_0~15 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=40b0b58fac4674aa5e0bedef69523fcdf9949813;p=modules%2Fgui.git IPAL19557 --- diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 500e21558..db2e4ef52 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -413,6 +413,15 @@ QtxWorkstackArea::~QtxWorkstackArea() QApplication::instance()->removeEventFilter( this ); } +/*! + \brief Check if workarea contains any widgets. + \return \c true if area is null (havn't any child widgets) +*/ +bool QtxWorkstackArea::isNull() const +{ + return myList.isEmpty(); +} + /*! \brief Check if workarea contains visible widgets. \return \c true if area is empty (all child widgets are removed or now shown) @@ -517,13 +526,10 @@ void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del ) myChild.remove( wid ); if ( del ) - { delete child( wid ); - if ( myList.isEmpty() ) - delete this; - else - updateState(); - } + + if ( isNull() ) + deleteLater(); else updateState(); } diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index d549965d3..367713bf9 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -168,6 +168,7 @@ public: QtxWorkstackArea( QWidget* ); virtual ~QtxWorkstackArea(); + bool isNull() const; bool isEmpty() const; QWidget* insertWidget( QWidget*, const int = -1, Qt::WindowFlags = 0 );