From: ana Date: Thu, 25 Feb 2010 08:54:51 +0000 (+0000) Subject: Fix bugs with default dialog button on Windows X-Git-Tag: V5_1_4a1~28 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=365eee7a95018587b58828c49b4dec8f9bcff95d;p=modules%2Fgui.git Fix bugs with default dialog button on Windows --- diff --git a/src/LightApp/LightApp_ModuleDlg.cxx b/src/LightApp/LightApp_ModuleDlg.cxx index fe0864703..ddbbd87cf 100644 --- a/src/LightApp/LightApp_ModuleDlg.cxx +++ b/src/LightApp/LightApp_ModuleDlg.cxx @@ -178,6 +178,8 @@ LightApp_ModuleDlg::LightApp_ModuleDlg( QWidget* parent, // 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 );