From: asl Date: Fri, 14 Oct 2005 12:21:53 +0000 (+0000) Subject: PAL9994 X-Git-Tag: BR-D5-38-2003_D2005-12-19~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd17b026b3f391c7af9d38fede7cdfc449c76704;p=modules%2Fgui.git PAL9994 --- diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 59e3637a9..880ce2136 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1138,6 +1138,9 @@ void Plot2d_ViewFrame::setXGrid( bool xMajorEnabled, const int xMajorMax, bool xMinorEnabled, const int xMinorMax, bool update ) { + if( xMinorMax>=xMajorMax ) + return; + myXGridMajorEnabled = xMajorEnabled; myXGridMinorEnabled = xMinorEnabled; myXGridMaxMajor = xMajorMax; diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 25358a51b..f7e7ae7b6 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -1145,6 +1145,7 @@ void QtxWorkstackArea::insertWidget( QWidget* wid, const int idx ) myInfo[wid].vis = wid->isVisibleTo( wid->parentWidget() ); connect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) ); + connect( wid, SIGNAL( destroyed() ), this, SLOT( onWidgetDestroyed() ) ); connect( child, SIGNAL( shown( QtxWorkstackChild* ) ), this, SLOT( onChildShown( QtxWorkstackChild* ) ) ); connect( child, SIGNAL( hided( QtxWorkstackChild* ) ), this, SLOT( onChildHided( QtxWorkstackChild* ) ) ); connect( child, SIGNAL( activated( QtxWorkstackChild* ) ), this, SLOT( onChildActivated( QtxWorkstackChild* ) ) ); @@ -1156,7 +1157,13 @@ void QtxWorkstackArea::insertWidget( QWidget* wid, const int idx ) setWidgetActive( wid ); } -void QtxWorkstackArea::removeWidget( QWidget* wid ) +void QtxWorkstackArea::onWidgetDestroyed() +{ + if( sender() ) + removeWidget( (QWidget*)sender(), false ); +} + +void QtxWorkstackArea::removeWidget( QWidget* wid, const bool del ) { if ( !myList.contains( wid ) ) return; @@ -1169,10 +1176,14 @@ void QtxWorkstackArea::removeWidget( QWidget* wid ) myInfo.remove( wid ); myChild.remove( wid ); - delete child( wid ); - - if ( myList.isEmpty() ) - delete this; + if( del ) + { + delete child( wid ); + if( myList.isEmpty() ) + delete this; + else + updateState(); + } else updateState(); } diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index 5b7d10d54..a201ad2ff 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -128,7 +128,7 @@ public: bool isEmpty() const; void insertWidget( QWidget*, const int = -1 ); - void removeWidget( QWidget* ); + void removeWidget( QWidget*, const bool = true ); QWidget* activeWidget() const; void setActiveWidget( QWidget* ); @@ -162,6 +162,8 @@ private slots: void onClose(); void onSelected( int ); + void onWidgetDestroyed(); + void onDragActiveTab(); void onChildDestroyed( QObject* ); void onChildShown( QtxWorkstackChild* );