Salome HOME
Issue #1852 In the Sketcher, replace all disabled real inputs by labels
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetLabelValue.cpp
index aafbb4ba2e07ac20d164aef0e290c9f460e2ce67..9037e84ebb0552b5f9c1955e588c52d0c32fe9db 100644 (file)
@@ -28,6 +28,12 @@ ModuleBase_WidgetLabelValue::ModuleBase_WidgetLabelValue(QWidget* theParent,
   QString aToolTip = QString::fromStdString(theData->widgetTooltip());
 
   myLabel = new ModuleBase_LabelValue(theParent, aText, aToolTip, aLabelIcon);
+  bool isOk;
+  double aDefVal = QString::fromStdString(getDefaultValue()).toDouble(&isOk);
+  if (isOk) {
+    myLabel->setValue(aDefVal);
+  }
+
   aLayout->addWidget(myLabel);
 }
 
@@ -37,7 +43,9 @@ ModuleBase_WidgetLabelValue::~ModuleBase_WidgetLabelValue()
 
 QList<QWidget*> ModuleBase_WidgetLabelValue::getControls() const
 {
-  return QList<QWidget*>();
+  QList<QWidget*> aControls;
+  aControls.append(myLabel);
+  return aControls;
 }
 
 bool ModuleBase_WidgetLabelValue::restoreValueCustom()