Salome HOME
Issue #206: Clear selection after create operation commit
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
1 // File:        ModuleBase_Tools.cpp
2 // Created:     11 July 2014
3 // Author:      Vitaly Smetannikov
4
5 #include "ModuleBase_Tools.h"
6 #include <ModelAPI_ResultBody.h>
7 #include <ModelAPI_ResultConstruction.h>
8 #include <ModelAPI_Document.h>
9
10 namespace ModuleBase_Tools {
11
12 //******************************************************************
13
14 //******************************************************************
15
16 void adjustMargins(QWidget* theWidget)
17 {
18   if(!theWidget)
19     return;
20   adjustMargins(theWidget->layout());
21 }
22
23 void adjustMargins(QLayout* theLayout)
24 {
25   if(!theLayout)
26     return;
27   theLayout->setContentsMargins(2, 5, 5, 2);
28   theLayout->setSpacing(4);
29 }
30
31 void zeroMargins(QWidget* theWidget)
32 {
33   if(!theWidget)
34     return;
35   zeroMargins(theWidget->layout());
36 }
37
38 void zeroMargins(QLayout* theLayout)
39 {
40   if(!theLayout)
41     return;
42   theLayout->setContentsMargins(0, 0, 0, 0);
43   theLayout->setSpacing(5);
44 }
45
46 }