Salome HOME
Correction of Boolean crash
authornds <nds@opencascade.com>
Wed, 20 Apr 2016 08:40:06 +0000 (11:40 +0300)
committernds <nds@opencascade.com>
Wed, 20 Apr 2016 08:40:32 +0000 (11:40 +0300)
src/FeaturesPlugin/boolean_widget.xml
src/ModuleBase/ModuleBase_WidgetAction.cpp
src/ModuleBase/ModuleBase_WidgetChoice.cpp
src/ModuleBase/ModuleBase_WidgetDoubleValue.cpp
src/ModuleBase/ModuleBase_WidgetIntValue.cpp
src/ModuleBase/ModuleBase_WidgetLineEdit.cpp
src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp
src/PartSet/PartSet_Module.cpp
src/SketchPlugin/SketchPlugin_Sketch.cpp

index 109fa58cbec13d82db0585adaa2d4700d4dc1af1..53a10a97bb7b7239dff50bda2c9afe6c1a179b55 100644 (file)
@@ -8,7 +8,7 @@
     tooltip="Type of boolean operation"
     string_list="Cut Fuse Common Smash"
     use_in_title="true"
-    icons_list="icons/Features/bool_cut.png :icons/bool_fuse.png :icons/bool_common.png :icons/bool_smash.png"
+    icons_list="icons/Features/bool_cut.png icons/Features/bool_fuse.png icons/Features/bool_common.png icons/Features/bool_smash.png"
     default="0"
   />
   <multi_selector id="main_objects"
index 3d9c616ff29a36e9b52fa4bc2e0f1fc6b083c1c5..84b5ceb649311f270492eb98371decc8fec1b311 100755 (executable)
@@ -6,6 +6,7 @@
 
 #include <ModuleBase_WidgetAction.h>
 #include <ModuleBase_Tools.h>
+#include <ModuleBase_IconFactory.h>
 
 #include <Config_WidgetAPI.h>
 
@@ -35,7 +36,7 @@ ModuleBase_WidgetAction::ModuleBase_WidgetAction(QWidget* theParent,
 
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
   if (!aLabelIcon.isEmpty())
-    myButton->setIcon(QPixmap(aLabelIcon));
+    myButton->setIcon(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
   else
     myButton->setText(aText);
   myButton->setToolTip(aToolTip);
index 3d26909bf73c3d03c6f7915314f9c8c9a7c591d0..5797e7cc8de201b0882d34a9a37610fe44bdf8cd 100644 (file)
@@ -84,7 +84,7 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent,
   } else {
     myLabel = new QLabel(aLabelText, this);
     if (!aLabelIcon.isEmpty())
-      myLabel->setPixmap(QPixmap(aLabelIcon));
+      myLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
     aLayout->addWidget(myLabel);
 
     std::string aToolstr = theData->widgetTooltip();
index 5bbf1844712b1eab73972be19f1c9c89d8489d5a..e6408e212f2ecb61e774237c7e63b783f01b0f20 100644 (file)
@@ -14,6 +14,7 @@
 #include <ModuleBase_ParamSpinBox.h>
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_WidgetDoubleValue.h>
+#include <ModuleBase_IconFactory.h>
 
 #include <QFormLayout>
 #include <QLabel>
@@ -44,7 +45,7 @@ ModuleBase_WidgetDoubleValue::ModuleBase_WidgetDoubleValue(QWidget* theParent,
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
   myLabel = new QLabel(aLabelText, this);
   if (!aLabelIcon.isEmpty())
-    myLabel->setPixmap(QPixmap(aLabelIcon));
+    myLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
 
   bool aAcceptVariables = theData->getBooleanAttribute(DOUBLE_WDG_ACCEPT_EXPRESSIONS, true);
 
index 996e16fb5d022346957cf324bc5725b9d635b095..dae84951aaad0b9154d8c5177f2723923c1a433f 100644 (file)
@@ -8,6 +8,7 @@
 #include <ModuleBase_ParamSpinBox.h>
 #include <ModuleBase_Tools.h>
 #include <ModuleBase_ParamIntSpinBox.h>
+#include <ModuleBase_IconFactory.h>
 
 #include <ModelAPI_AttributeInteger.h>
 #include <ModelAPI_Data.h>
@@ -45,7 +46,7 @@ ModuleBase_WidgetIntValue::ModuleBase_WidgetIntValue(QWidget* theParent,
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
   myLabel = new QLabel(aLabelText, this);
   if (!aLabelIcon.isEmpty())
-    myLabel->setPixmap(QPixmap(aLabelIcon));
+    myLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
 
   mySpinBox = new ModuleBase_ParamIntSpinBox(this);
   QString anObjName = QString::fromStdString(attributeID());
index 54223e6d26c0082e5ffaa975afad732a02b34de1..ef869fdcd3bc606aac71187115743b54646a6e36 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <ModuleBase_WidgetLineEdit.h>
 #include <ModuleBase_Tools.h>
+#include <ModuleBase_IconFactory.h>
 
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_Data.h>
@@ -84,7 +85,7 @@ ModuleBase_WidgetLineEdit::ModuleBase_WidgetLineEdit(QWidget* theParent,
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
   QLabel* aLabel = new QLabel(aLabelText, this);
   if (!aLabelIcon.isEmpty())
-    aLabel->setPixmap(QPixmap(aLabelIcon));
+    aLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
 
   myLineEdit = new CustomLineEdit( this, QString::fromStdString( thePlaceHolder ) );
   // Here we do not use the Qt's standard method setPlaceHolderText() since it
index 57852847b4e8ade7e78ce1de95ae7deaec843eb8..a4dc153777f933a752f5f0f0aaffbc8731922bed 100755 (executable)
@@ -16,6 +16,7 @@
 #include <ModuleBase_Definitions.h>
 #include <ModuleBase_IModule.h>
 #include <ModuleBase_ViewerPrs.h>
+#include <ModuleBase_IconFactory.h>
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Object.h>
@@ -122,7 +123,7 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen
     QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
     if (!aLabelIcon.isEmpty()) {
       QLabel* aSelectedLabel = new QLabel("", this);
-      aSelectedLabel->setPixmap(QPixmap(aLabelIcon));
+      aSelectedLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
       aMainLay->addWidget(aSelectedLabel, 1, 1);
     }
     aMainLay->setColumnStretch(2, 1);
index c59fdceafd44dc588bacf8bf8274cd06f5d756ac..013b89d3c9b74063bb472513cafe5fa04b9f0aa3 100644 (file)
@@ -14,6 +14,7 @@
 #include <ModuleBase_Filter.h>
 #include <ModuleBase_IModule.h>
 #include <ModuleBase_ViewerPrs.h>
+#include <ModuleBase_IconFactory.h>
 
 #include <Config_WidgetAPI.h>
 #include <Events_Loop.h>
@@ -77,7 +78,7 @@ ModuleBase_WidgetShapeSelector::ModuleBase_WidgetShapeSelector(QWidget* theParen
   QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
   myLabel = new QLabel(aLabelText, this);
   if (!aLabelIcon.isEmpty())
-    myLabel->setPixmap(QPixmap(aLabelIcon));
+    myLabel->setPixmap(ModuleBase_IconFactory::loadPixmap(aLabelIcon));
 
 
   QString aToolTip = QString::fromStdString(theData->widgetTooltip());
index 5cf3d5e5a014f953406504e9f5325cce392fd0b1..e2e1f3600afa6496fe725463b2b238e0afa73b06 100755 (executable)
@@ -1305,7 +1305,8 @@ void PartSet_Module::onChoiceChanged(ModuleBase_ModelWidget* theWidget,
     if (!aOperation)
       return;
     ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
-    aPanel->setWindowTitle(aChoiceTitle);
+    if (aPanel)
+      aPanel->setWindowTitle(aChoiceTitle);
   }
 }
 
index e30faa17a22d7cd11caf902d55ee014ab685fb14..053957cc5e9a3fb5245c95e7f51c47a2154e7b5d 100644 (file)
@@ -55,9 +55,11 @@ void SketchPlugin_Sketch::initAttributes()
   ModelAPI_Session::get()->validators()->registerNotObligatory(
     getKind(), SketchPlugin_SketchEntity::EXTERNAL_ID());
   data()->addAttribute(SketchPlugin_Sketch::SOLVER_ERROR(), ModelAPI_AttributeString::typeId());
-  data()->addAttribute(SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString::typeId());
   ModelAPI_Session::get()->validators()->registerNotObligatory(
     getKind(), SketchPlugin_Sketch::SOLVER_ERROR());
+  data()->addAttribute(SketchPlugin_Sketch::SOLVER_DOF(), ModelAPI_AttributeString::typeId());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(
+    getKind(), SketchPlugin_Sketch::SOLVER_DOF());
 }
 
 void SketchPlugin_Sketch::execute()