]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
remove excess separators between invisible widgets
authorptv <ptv@opencascade.com>
Fri, 3 Nov 2006 14:24:25 +0000 (14:24 +0000)
committerptv <ptv@opencascade.com>
Fri, 3 Nov 2006 14:24:25 +0000 (14:24 +0000)
src/Qtx/Qtx.cxx

index ae3cb9d02692fab9e276c94f6958317461e18980..5e03c61686c61cf95ef214b1c97f233c3e86cc03 100755 (executable)
@@ -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;
   }