]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Selection of the text in the editor control
authornds <natalia.donis@opencascade.com>
Wed, 4 Mar 2015 11:12:54 +0000 (14:12 +0300)
committernds <natalia.donis@opencascade.com>
Wed, 4 Mar 2015 11:12:54 +0000 (14:12 +0300)
src/ModuleBase/ModuleBase_WidgetEditor.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/PartSet/PartSet_WidgetPoint2d.cpp
src/SketchPlugin/SketchPlugin_Feature.h

index 07c59651de695bdd6de1d735644fe43719c550b2..8c3b74bdfd4f372db20791bea0838dd6aefc0502 100644 (file)
@@ -47,6 +47,7 @@ double editedValue(double theValue, bool& isDone)
   ModuleBase_Tools::zeroMargins(aLay);
 
   QLineEdit* aEditor = new QLineEdit(QString::number(theValue), &aDlg);
+  aEditor->selectAll();
   aEditor->setValidator(new QDoubleValidator(aEditor));
   QObject::connect(aEditor, SIGNAL(returnPressed()), &aDlg, SLOT(accept()));
   aLay->addWidget(aEditor);
index 34fc4ec41627912086b5ceb8b940ad8c1e9cfdc6..5514a06e34dbfbff28dbd0468317c85b4fad57f3 100644 (file)
@@ -447,7 +447,8 @@ void ModuleBase_WidgetShapeSelector::selectionFilters(SelectMgr_ListOfFilter& th
   if (!myObjectTypes.isEmpty() && myObjTypeFilter.IsNull()) {
     myObjTypeFilter = new ModuleBase_ObjectTypesFilter(myWorkshop, myObjectTypes);
   }
-  theFilters.Append(myObjTypeFilter);
+  if (!myObjTypeFilter.IsNull())
+    theFilters.Append(myObjTypeFilter);
 
   // apply filters loaded from the XML definition of the widget
   ModuleBase_FilterFactory* aFactory = myWorkshop->selectionFilters();
index 4915eec35201537b768103594bef64ad398602b6..d011bb5d2801ff7ade90cf0d4f58caf2b7e57017 100644 (file)
@@ -54,6 +54,8 @@ PartSet_WidgetPoint2D::PartSet_WidgetPoint2D(QWidget* theParent,
                                               const std::string& theParentId)
     : ModuleBase_ModelWidget(theParent, theData, theParentId)
 {
+  // the control should accept the focus, so the boolen flag is corrected to be true
+  myIsObligatory = true;
   //myOptionParam = theData->getProperty(PREVIOUS_FEATURE_PARAM);
   QString aPageName = QString::fromStdString(theData->getProperty(CONTAINER_PAGE_NAME));
   myGroupBox = new QGroupBox(aPageName, theParent);
index 607f66725fd652e53a5f197cc0aee2f38746b6ec..4be01f0a671d9f67e746adb41159ae4526716c93 100644 (file)
@@ -88,7 +88,9 @@ class SketchPlugin_Feature : public ModelAPI_Feature, public GeomAPI_ICustomPrs
     if (aShapeType != 6/*an edge*/ && aShapeType != 7/*a vertex*/)
       return;
 
-    bool isConstruction = data()->boolean(SketchPlugin_Feature::CONSTRUCTION_ID())->value();
+    std::shared_ptr<ModelAPI_AttributeBoolean> aConstructionAttr =
+                                   data()->boolean(SketchPlugin_Feature::CONSTRUCTION_ID());
+    bool isConstruction = aConstructionAttr.get() != NULL && aConstructionAttr->value();
     if (aShapeType == 6) { // if this is an edge
       if (isConstruction) {
         thePrs->setWidth(1);