]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
Salome HOME
Add tools
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetMultiSelector.cpp
index b83e14576ac94d789cb0b7de800aaca559152437..8a703d3208963f6d253f7ad3863b2b09510c431c 100755 (executable)
@@ -15,8 +15,6 @@
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_Definitions.h>
 
-#include <GeomValidators_ShapeType.h>
-
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Object.h>
 #include <ModelAPI_AttributeSelectionList.h>
@@ -79,14 +77,15 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen
 
   std::string aPropertyTypes = theData->getProperty("type_choice");
   QString aTypesStr = aPropertyTypes.c_str();
-  QStringList aShapeTypes = aTypesStr.split(' ');
+  QStringList aShapeTypes = aTypesStr.split(' ', QString::SkipEmptyParts);
 
   myIsUseChoice = theData->getBooleanAttribute("use_choice", true);
 
-  myTypeCombo->addItems(aShapeTypes);
+  if (!aShapeTypes.empty())
+    myTypeCombo->addItems(aShapeTypes);
   aMainLay->addWidget(myTypeCombo, 0, 1);
   // if the xml definition contains one type, the controls to select a type should not be shown
-  if (aShapeTypes.size() == 1 || !myIsUseChoice) {
+  if (aShapeTypes.size() <= 1 || !myIsUseChoice) {
     aTypeLabel->setVisible(false);
     myTypeCombo->setVisible(false);
   }
@@ -96,7 +95,7 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen
                                                       : tr("Selected objects:"), this);
   aMainLay->addWidget(aListLabel, 1, 0);
   // if the xml definition contains one type, an information label should be shown near to the latest
-  if (aShapeTypes.size() == 1) {
+  if (aShapeTypes.size() <= 1) {
     QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
     if (!aLabelIcon.isEmpty()) {
       QLabel* aSelectedLabel = new QLabel("", this);