bool xMinorEnabled, const int xMinorMax,
bool update )
{
+ if( xMinorMax>=xMajorMax )
+ return;
+
myXGridMajorEnabled = xMajorEnabled;
myXGridMinorEnabled = xMinorEnabled;
myXGridMaxMajor = xMajorMax;
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* ) ) );
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;
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();
}
bool isEmpty() const;
void insertWidget( QWidget*, const int = -1 );
- void removeWidget( QWidget* );
+ void removeWidget( QWidget*, const bool = true );
QWidget* activeWidget() const;
void setActiveWidget( QWidget* );
void onClose();
void onSelected( int );
+ void onWidgetDestroyed();
+
void onDragActiveTab();
void onChildDestroyed( QObject* );
void onChildShown( QtxWorkstackChild* );