From: gdd Date: Mon, 31 Jan 2011 16:23:26 +0000 (+0000) Subject: The GEOM Delete Dialog uses 2 QPushButtons for the Yes/No buttons whereas the SMESH... X-Git-Tag: Start_BR_19998_21191~78 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f4eb77303259394d0ce56ef7139b64c8fc9a0ba4;p=modules%2Fgeom.git The GEOM Delete Dialog uses 2 QPushButtons for the Yes/No buttons whereas the SMESH one uses a QMessage dialog. To make them coherent (same layout order), use a QDialogButtonBox in the GEOM Delete Dialog. --- diff --git a/src/GEOMToolsGUI/GEOMToolsGUI_DeleteDlg.cxx b/src/GEOMToolsGUI/GEOMToolsGUI_DeleteDlg.cxx index d8ee5ff6f..a2df755b4 100644 --- a/src/GEOMToolsGUI/GEOMToolsGUI_DeleteDlg.cxx +++ b/src/GEOMToolsGUI/GEOMToolsGUI_DeleteDlg.cxx @@ -24,7 +24,7 @@ #include "GEOMToolsGUI_DeleteDlg.h" #include -#include +#include #include #include #include @@ -108,21 +108,13 @@ GEOMToolsGUI_DeleteDlg::GEOMToolsGUI_DeleteDlg( QWidget* parent, lab->setText( tr( "GEOM_REALLY_DELETE_ALL" ) ); } - QPushButton* buttonYes = new QPushButton( tr( "GEOM_BUT_YES" ), this ); - QPushButton* buttonNo = new QPushButton( tr( "GEOM_BUT_NO" ), this ); - QHBoxLayout* btnLayout = new QHBoxLayout; - btnLayout->setMargin( 0 ); - btnLayout->setSpacing( 6 ); - btnLayout->addWidget( buttonYes ); - btnLayout->addSpacing( 10 ); - btnLayout->addStretch(); - btnLayout->addWidget( buttonNo ); + QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok + | QDialogButtonBox::Cancel); int rc = topLayout->rowCount(); - topLayout->addLayout( btnLayout, rc, 0, 1, 2 ); + topLayout->addWidget( buttonBox, rc, 1, 1, 1 ); - /* signals and slots connections */ - connect( buttonYes, SIGNAL( clicked() ), this, SLOT( accept() ) ); - connect( buttonNo, SIGNAL( clicked() ), this, SLOT( reject() ) ); + connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept())); + connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); } GEOMToolsGUI_DeleteDlg::~GEOMToolsGUI_DeleteDlg()