]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix of removing toolbar separators when part of actions is hidden (from CSCdev)
authorsln <sln@opencascade.com>
Tue, 13 Feb 2007 14:56:42 +0000 (14:56 +0000)
committersln <sln@opencascade.com>
Tue, 13 Feb 2007 14:56:42 +0000 (14:56 +0000)
src/Qtx/Qtx.cxx

index 6e2a31648aecf3e0ef337076bc916b49181ebb29..c50fd38dd11c22e544737572e324befa3605fa3e 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;
   }