X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetChoice.cpp;h=83537b71d3bcf293047252fea682769153a22c48;hb=c8e35a67c60489a46aaf7c8ff75001511ac2635b;hp=b2d017db6b5aa0d39c3879270a2d0854e242e28e;hpb=35a88fdd724349275bbff32b9596a44e7cd422e2;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index b2d017db6..83537b71d 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModuleBase_WidgetChoice.cpp // Created: 03 Sept 2014 // Author: Vitaly Smetannikov @@ -19,18 +21,17 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, const std::string& theParentId) : ModuleBase_ModelWidget(theParent, theData, theParentId) { - myContainer = new QWidget(theParent); - QHBoxLayout* aLayout = new QHBoxLayout(myContainer); + QHBoxLayout* aLayout = new QHBoxLayout(this); ModuleBase_Tools::adjustMargins(aLayout); QString aLabelText = QString::fromStdString(theData->widgetLabel()); QString aLabelIcon = QString::fromStdString(theData->widgetIcon()); - myLabel = new QLabel(aLabelText, myContainer); + myLabel = new QLabel(aLabelText, this); if (!aLabelIcon.isEmpty()) myLabel->setPixmap(QPixmap(aLabelIcon)); aLayout->addWidget(myLabel); - myCombo = new QComboBox(myContainer); + myCombo = new QComboBox(this); aLayout->addWidget(myCombo, 1); std::string aTypes = theData->getProperty("string_list"); @@ -44,7 +45,7 @@ ModuleBase_WidgetChoice::~ModuleBase_WidgetChoice() { } -bool ModuleBase_WidgetChoice::storeValue() const +bool ModuleBase_WidgetChoice::storeValueCustom() const { DataPtr aData = myFeature->data(); std::shared_ptr aIntAttr = aData->integer(attributeID()); @@ -81,5 +82,6 @@ QList ModuleBase_WidgetChoice::getControls() const void ModuleBase_WidgetChoice::onCurrentIndexChanged(int theIndex) { emit valuesChanged(); - emit focusOutWidget(this); + // Don't transfer focus + // emit focusOutWidget(this); }