From: ptv Date: Fri, 3 Nov 2006 14:24:25 +0000 (+0000) Subject: remove excess separators between invisible widgets X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0e2b9864e5bc994ec74263eab33f9f7f7ef8971c;p=modules%2Fgui.git remove excess separators between invisible widgets --- diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index ae3cb9d02..5e03c6168 100755 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -182,9 +182,12 @@ void Qtx::simplifySeparators( QToolBar* toolbar ) bool isPrevSep = true; for ( QObjectListIt it( *objList ); it.current(); ++it ) { - bool isSep = it.current()->isA( "QToolBarSeparator" ); + QObject* obj = it.current(); + if ( !obj || !obj->isWidgetType() || !((QWidget*)obj)->isVisibleTo( toolbar ) ) + continue; + bool isSep = obj->isA( "QToolBarSeparator" ); if ( isPrevSep && isSep ) - delList.append( it.current() ); + delList.append( obj ); isPrevSep = isSep; }