Salome HOME
Define abstract module class
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index f68de8da5cba818502ee05c88496a59d239488e9..ffb17b5c2b2560c666c15fa902234819e1d5da87 100644 (file)
@@ -12,4 +12,35 @@ namespace ModuleBase_Tools {
 //******************************************************************
 
 //******************************************************************
+
+void adjustMargins(QWidget* theWidget)
+{
+  if(!theWidget)
+    return;
+  adjustMargins(theWidget->layout());
+}
+
+void adjustMargins(QLayout* theLayout)
+{
+  if(!theLayout)
+    return;
+  theLayout->setContentsMargins(5, 5, 5, 5);
+  theLayout->setSpacing(5);
+}
+
+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);
+}
+
 }