Salome HOME
Fix regression in unit tests
[modules/shaper.git] / src / ModuleBase / ModuleBase_ToolBox.cpp
index 88bb944d8e9138de571afebf79c195e9f01a86d0..57c7332c6f85f9822553f3bb4940c51ed4c74549 100644 (file)
@@ -23,7 +23,7 @@ ModuleBase_ToolBox::ModuleBase_ToolBox( QWidget* theParent )
   aMainLayout->addWidget( myButtonsFrame, 0 );
   aMainLayout->addWidget( myStack, 1 );
 
-  myButtonsGroup = new QButtonGroup();
+  myButtonsGroup = new QButtonGroup(this);
   myButtonsGroup->setExclusive( true );
   myButtonsLayout = new QHBoxLayout( myButtonsFrame );
   myButtonsLayout->setMargin( 0 );
@@ -45,10 +45,12 @@ void ModuleBase_ToolBox::addItem( QWidget* thePage, const QString& theName, cons
   myStack->addWidget( thePage );
 
   QToolButton* aButton = new QToolButton( myButtonsFrame );
+  aButton->setFocusPolicy(Qt::StrongFocus);
   aButton->setCheckable( true );
   aButton->setIcon( theIcon );
   aButton->setIconSize( theIcon.size() );
   aButton->setToolTip( theName );
+  aButton->setObjectName( theName );
   myButtonsGroup->addButton( aButton, anOldCount );
   myButtonsLayout->insertWidget( anOldCount, aButton );
 }