Salome HOME
Issue #412: Crash on delete sketch line with constraints
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index 21fa0db1f29eb7d676bf0b2aab3a964a6272268b..06e8fb08dc8befc26ccd7f1dda8c3304313598eb 100644 (file)
@@ -9,6 +9,7 @@
 #include <QLayout>
 #include <QPainter>
 #include <QBitmap>
+#include <QDoubleSpinBox>
 
 namespace ModuleBase_Tools {
 
@@ -27,7 +28,7 @@ void adjustMargins(QLayout* theLayout)
 {
   if(!theLayout)
     return;
-  theLayout->setContentsMargins(2, 5, 5, 2);
+  theLayout->setContentsMargins(2, 5, 2, 5);
   theLayout->setSpacing(4);
 }
 
@@ -97,6 +98,13 @@ QPixmap lighter(const QString& theIcon, const int theLighterValue)
   return QPixmap::fromImage(aResult);
 }
 
+void setSpinValue(QDoubleSpinBox* theSpin, double theValue)
+{
+  bool isBlocked = theSpin->blockSignals(true);
+  theSpin->setValue(theValue);
+  theSpin->blockSignals(isBlocked);
+}
+
 }