]> SALOME platform Git repositories - modules/shaper.git/blob - src/ModuleBase/ModuleBase_Tools.cpp
Salome HOME
Redesign of operations architecture
[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 <QWidget>
7 #include <QLayout>
8
9 namespace ModuleBase_Tools {
10
11 //******************************************************************
12
13 //******************************************************************
14
15 void adjustMargins(QWidget* theWidget)
16 {
17   if(!theWidget)
18     return;
19   adjustMargins(theWidget->layout());
20 }
21
22 void adjustMargins(QLayout* theLayout)
23 {
24   if(!theLayout)
25     return;
26   theLayout->setContentsMargins(2, 5, 5, 2);
27   theLayout->setSpacing(4);
28 }
29
30 void zeroMargins(QWidget* theWidget)
31 {
32   if(!theWidget)
33     return;
34   zeroMargins(theWidget->layout());
35 }
36
37 void zeroMargins(QLayout* theLayout)
38 {
39   if(!theLayout)
40     return;
41   theLayout->setContentsMargins(0, 0, 0, 0);
42   theLayout->setSpacing(5);
43 }
44
45
46
47 }
48
49