X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetChoice.cpp;h=d837c4f38b10efcf2ef81d38730bbaa74ec291db;hb=29dfb8a802f61cacf5f57fb79c62badee00ebcdf;hp=4b09ffab63f7f6fd637f3132ca66ebb2789934a4;hpb=6dffec58e6c28dbc908b718e3bfd92c236d4a9fc;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index 4b09ffab6..d837c4f38 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -56,6 +56,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, int aId = 0; foreach(QString aBtnTxt, aList) { QToolButton* aBtn = new QToolButton(aGroupBox); + aBtn->setFocusPolicy(Qt::StrongFocus); aBtn->setCheckable(true); aBtn->setToolTip(aBtnTxt); @@ -77,6 +78,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, } myButtons->button(0)->setChecked(true); connect(myButtons, SIGNAL(buttonClicked(int)), this, SLOT(onCurrentIndexChanged(int))); + connect(myButtons, SIGNAL(buttonClicked(int)), this, SIGNAL(itemSelected(int))); } else { myLabel = new QLabel(aLabelText, this); if (!aLabelIcon.isEmpty()) @@ -94,6 +96,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, myCombo->addItems(aList); connect(myCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onCurrentIndexChanged(int))); + connect(myCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(itemSelected(int))); } } @@ -128,6 +131,7 @@ bool ModuleBase_WidgetChoice::restoreValueCustom() bool isBlocked = myButtons->blockSignals(true); myButtons->button(aIntAttr->value())->setChecked(true); myButtons->blockSignals(isBlocked); + emit itemSelected(aIntAttr->value()); } } return true; @@ -136,9 +140,9 @@ bool ModuleBase_WidgetChoice::restoreValueCustom() bool ModuleBase_WidgetChoice::focusTo() { if (myCombo) - myCombo->setFocus(); + ModuleBase_Tools::setFocus(myCombo, "ModuleBase_WidgetChoice::focusTo()"); else - myButtons->button(0)->setFocus(); + return false; return true; }