Salome HOME
Issue #1854 Recover feature control update
[modules/shaper.git] / src / ModuleBase / ModuleBase_PageWidget.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2 /*
3  * ModuleBase_PageWidget.cpp
4  *
5  *  Created on: Mar 4, 2015
6  *      Author: sbh
7  */
8
9 #include <ModuleBase_PageWidget.h>
10 #include <ModuleBase_ModelWidget.h>
11 #include <ModuleBase_Tools.h>
12
13 #include <QLayout>
14
15 #include <iostream>
16
17 ModuleBase_PageWidget::ModuleBase_PageWidget(QWidget* theParent)
18 : QFrame(theParent)
19 {
20   myMainLayout = new QVBoxLayout(this);
21   ModuleBase_Tools::adjustMargins(myMainLayout);
22   setLayout(myMainLayout);
23 }
24
25 ModuleBase_PageWidget::~ModuleBase_PageWidget()
26 {
27 }
28
29 void ModuleBase_PageWidget::addPageStretch()
30 {
31   myMainLayout->addStretch(1);
32 }
33
34 void ModuleBase_PageWidget::placeModelWidget(ModuleBase_ModelWidget* theWidget)
35 {
36   myMainLayout->addWidget(theWidget, 0);
37 }
38
39 void ModuleBase_PageWidget::placeWidget(QWidget* theWidget)
40 {
41   if (!theWidget) {
42     #ifdef _DEBUG
43     std::cout << "ModuleBase_PageWidget::placePageWidget: can not cast page" << std::endl;
44     #endif
45     return;
46   }
47   myMainLayout->addWidget(theWidget, 0);
48 }
49
50 QLayout* ModuleBase_PageWidget::pageLayout()
51 {
52   return myMainLayout;
53 }