Salome HOME
Fixed problem with too many executions of extrusion wit hexternal sketch edges
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index 87f636360229b6e5d2d68ee3fa910042cb5d957d..8df14bdc35b74bfb93fce4cdb053f9ac5c302114 100644 (file)
@@ -7,10 +7,40 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Document.h>
 
-namespace ModuleBase_Tools
-{
+namespace ModuleBase_Tools {
 
 //******************************************************************
 
 //******************************************************************
+
+void adjustMargins(QWidget* theWidget)
+{
+  if(!theWidget)
+    return;
+  adjustMargins(theWidget->layout());
+}
+
+void adjustMargins(QLayout* theLayout)
+{
+  if(!theLayout)
+    return;
+  theLayout->setContentsMargins(2, 5, 5, 2);
+  theLayout->setSpacing(4);
+}
+
+void zeroMargins(QWidget* theWidget)
+{
+  if(!theWidget)
+    return;
+  zeroMargins(theWidget->layout());
+}
+
+void zeroMargins(QLayout* theLayout)
+{
+  if(!theLayout)
+    return;
+  theLayout->setContentsMargins(0, 0, 0, 0);
+  theLayout->setSpacing(5);
+}
+
 }