From: sln Date: Tue, 13 Feb 2007 14:56:42 +0000 (+0000) Subject: Fix of removing toolbar separators when part of actions is hidden (from CSCdev) X-Git-Tag: CTH_V12~17 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6c8a347d0c02e615e7a040d1a1cb8839ba546a13;p=modules%2Fgui.git Fix of removing toolbar separators when part of actions is hidden (from CSCdev) --- diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index 6e2a31648..c50fd38dd 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; }