From 0e2b9864e5bc994ec74263eab33f9f7f7ef8971c Mon Sep 17 00:00:00 2001 From: ptv Date: Fri, 3 Nov 2006 14:24:25 +0000 Subject: [PATCH] remove excess separators between invisible widgets --- 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 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; } -- 2.39.2