if ( area->isEmpty() )
continue;
info += QString( "(views active='%1'" ).arg( area->activeWidget()->name() );
- QWidgetList views = area->widgetList( false );
+ QWidgetList views = area->widgetList( true );
for ( QWidgetListIt wIt( views ); wIt.current(); ++wIt )
info += QString( " '%1'%2" ).arg( wIt.current()->name() ).
arg( wIt.current()->isVisibleTo( wIt.current()->parentWidget() ) ? "+" : "-" );
{
if ( QWidget* view = ::getView( splitter, viewName ) )
{
+ newArea->insertWidget( view, -1, vis ? 1 : -1 );
view->setShown( vis );
- newArea->insertWidget( view );
if ( activeViewName == view->name() )
activeView = view;
}
\param wid - widget
\param idx - index
*/
-void QtxWorkstackArea::insertWidget( QWidget* wid, const int idx )
+void QtxWorkstackArea::insertWidget( QWidget* wid, const int idx, const int vis )
{
if ( !wid )
return;
{
QtxWorkstackChild* child = new QtxWorkstackChild( wid, myStack );
myChild.insert( wid, child );
+
myInfo.insert( wid, WidgetInfo() );
myInfo[wid].id = generateId();
- myInfo[wid].vis = wid->isVisibleTo( wid->parentWidget() );
+ myInfo[wid].vis = vis == 0 ? wid->isVisibleTo( wid->parentWidget() ) : vis > 0;
connect( child, SIGNAL( destroyed( QObject* ) ), this, SLOT( onChildDestroyed( QObject* ) ) );
connect( wid, SIGNAL( destroyed() ), this, SLOT( onWidgetDestroyed() ) );
updateState();
- setWidgetActive( wid );
+ if ( widgetVisibility( wid ) )
+ setWidgetActive( wid );
+
wid->setFocus();
}
myWidget( wid )
{
myWidget->reparent( this, QPoint( 0, 0 ), myWidget->isVisibleTo( myWidget->parentWidget() ) );
+
myWidget->installEventFilter( this );
connect( myWidget, SIGNAL( destroyed( QObject* ) ), this, SLOT( onDestroyed( QObject* ) ) );