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