Salome HOME
Issue #1424: Make impossible to create non-valid parameters more the a one
[modules/shaper.git] / src / ModuleBase / ModuleBase_PageWidget.cpp
index f49e53eea1fed66f299c38036c746a983ba82af2..c351d0af404ae7b599281d618bc3bfb7fc784402 100644 (file)
@@ -9,12 +9,14 @@
 #include <ModuleBase_ModelWidget.h>
 #include <ModuleBase_Tools.h>
 
-#include <QGridLayout>
+#include <QLayout>
+
+#include <iostream>
 
 ModuleBase_PageWidget::ModuleBase_PageWidget(QWidget* theParent)
 : QFrame(theParent)
 {
-  myMainLayout = new QGridLayout(this);
+  myMainLayout = new QVBoxLayout(this);
   ModuleBase_Tools::adjustMargins(myMainLayout);
   setLayout(myMainLayout);
 }
@@ -25,28 +27,23 @@ ModuleBase_PageWidget::~ModuleBase_PageWidget()
 
 void ModuleBase_PageWidget::addPageStretch()
 {
-  myMainLayout->setRowStretch(myMainLayout->rowCount(), 1);
+  myMainLayout->addStretch(1);
 }
 
 void ModuleBase_PageWidget::placeModelWidget(ModuleBase_ModelWidget* theWidget)
 {
-  const int kCol = 0;
-  const int kRow = myMainLayout->count();
-  myMainLayout->addWidget(theWidget, kRow, kCol);
+  myMainLayout->addWidget(theWidget, 0);
 }
 
-void ModuleBase_PageWidget::placePageWidget(ModuleBase_PageBase* theWidget)
+void ModuleBase_PageWidget::placeWidget(QWidget* theWidget)
 {
-  QWidget* aWidget = dynamic_cast<QWidget*>(theWidget);
-  if (!aWidget) {
+  if (!theWidget) {
     #ifdef _DEBUG
     std::cout << "ModuleBase_PageWidget::placePageWidget: can not cast page" << std::endl;
     #endif
     return;
   }
-  const int kCol = 0;
-  const int kRow = myMainLayout->count();
-  myMainLayout->addWidget(aWidget, kRow, kCol);//, Qt::AlignTop | Qt::AlignLeft);
+  myMainLayout->addWidget(theWidget, 0);
 }
 
 QLayout* ModuleBase_PageWidget::pageLayout()