From 365eee7a95018587b58828c49b4dec8f9bcff95d Mon Sep 17 00:00:00 2001 From: ana Date: Thu, 25 Feb 2010 08:54:51 +0000 Subject: [PATCH] Fix bugs with default dialog button on Windows --- src/LightApp/LightApp_ModuleDlg.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 ); -- 2.39.2