]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Fix bugs with default dialog button on Windows
authorana <ana@opencascade.com>
Thu, 25 Feb 2010 08:54:51 +0000 (08:54 +0000)
committerana <ana@opencascade.com>
Thu, 25 Feb 2010 08:54:51 +0000 (08:54 +0000)
src/LightApp/LightApp_ModuleDlg.cxx

index fe086470337756492de79993727f05a562dbe3e1..ddbbd87cf52f66d6c9fc3b472fed81d6d2c81933 100644 (file)
@@ -178,6 +178,8 @@ LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget*       parent,
 
   // <Cancel>
   QPushButton* cancelBtn = new QPushButton( tr( "CANCEL" ), this );
+  cancelBtn->setAutoDefault( true );
+
   myButtonLayout->addSpacing( 70 );
   myButtonLayout->addStretch();
   myButtonLayout->addWidget( cancelBtn );
@@ -223,8 +225,12 @@ int LightApp_ModuleDlg::addButton( const QString& button, const int id )
   }
 
   QPushButton* newButton = new QPushButton( button, this );
+  newButton->setAutoDefault( true );
 
-  if ( myButtons.empty() ) newButton->setDefault( true );
+  if ( myButtons.empty() ) {
+       newButton->setDefault( true );
+       newButton->setFocus();
+  }
 
   myButtons.insert( newButton, bid );
   myButtonLayout->insertWidget( myButtonLayout->count()-3, newButton );