Salome HOME
Fix regression in unit tests
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetShapeSelector.cpp
index 16e0d2a620a7981077f4a70da738d17d14958055..4db52fd2a7171f6e309d193870a09856fa1c26cd 100644 (file)
 #include <ModuleBase_FilterFactory.h>
 #include <ModuleBase_Filter.h>
 
-#include <GeomValidators_ShapeType.h>
-
 #include <Config_WidgetAPI.h>
 #include <Events_Loop.h>
 #include <Events_Message.h>
 #include <GeomAPI_Interface.h>
 #include <GeomAPI_Shape.h>
-#include <GeomValidators_Tools.h>
 
 #include <ModelAPI_AttributeReference.h>
 #include <ModelAPI_Data.h>
@@ -37,7 +34,6 @@
 #include <ModelAPI_AttributeRefAttr.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_AttributeValidator.h>
-#include <ModelAPI_ShapeValidator.h>
 
 #include <Config_WidgetAPI.h>
 #include <Events_Error.h>
@@ -85,11 +81,14 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen
 
   QString aToolTip = QString::fromStdString(theData->widgetTooltip());
   myTextLine = new QLineEdit(this);
+  QString anObjName = QString::fromStdString(attributeID());
+  myTextLine->setObjectName(anObjName);
   myTextLine->setReadOnly(true);
   myTextLine->setToolTip(aToolTip);
   myTextLine->installEventFilter(this);
 
   aLayout->addRow(myLabel, myTextLine);
+  myLabel->setToolTip(aToolTip);
 
   std::string aTypes = theData->getProperty("shape_types");
   myShapeTypes = QString(aTypes.c_str()).split(' ', QString::SkipEmptyParts);
@@ -143,7 +142,7 @@ QList<ModuleBase_ViewerPrs> ModuleBase_WidgetShapeSelector::getAttributeSelectio
     DataPtr aData = myFeature->data();
     AttributePtr anAttribute = myFeature->attribute(attributeID());
 
-    ObjectPtr anObject = GeomValidators_Tools::getObject(anAttribute);
+    ObjectPtr anObject = ModuleBase_Tools::getObject(anAttribute);
     TopoDS_Shape aShape;
     std::shared_ptr<GeomAPI_Shape> aShapePtr = getShape();
     if (aShapePtr.get()) {
@@ -224,7 +223,7 @@ void ModuleBase_WidgetShapeSelector::updateSelectionName()
     isNameUpdated = true;
   }
   if (!isNameUpdated) {
-    ObjectPtr anObject = GeomValidators_Tools::getObject(myFeature->attribute(attributeID()));
+    ObjectPtr anObject = ModuleBase_Tools::getObject(myFeature->attribute(attributeID()));
     if (anObject.get() != NULL) {
       std::string aName = anObject->data()->name();
       myTextLine->setText(QString::fromStdString(aName));
@@ -254,7 +253,7 @@ void ModuleBase_WidgetShapeSelector::storeAttributeValue()
   DataPtr aData = myFeature->data();
   AttributePtr anAttribute = myFeature->attribute(attributeID());
 
-  myObject = GeomValidators_Tools::getObject(anAttribute);
+  myObject = ModuleBase_Tools::getObject(anAttribute);
   myShape = getShape();
   myRefAttribute = AttributePtr();
   myIsObject = false;