From 6c8a347d0c02e615e7a040d1a1cb8839ba546a13 Mon Sep 17 00:00:00 2001 From: sln Date: Tue, 13 Feb 2007 14:56:42 +0000 Subject: [PATCH] Fix of removing toolbar separators when part of actions is hidden (from CSCdev) --- src/Qtx/Qtx.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.39.2