Salome HOME
Issue #1383 Preview button: correction for the case: switch off auto_preview in extru...
[modules/shaper.git] / src / ModuleBase / ModuleBase_PageWidget.cpp
index f49e53eea1fed66f299c38036c746a983ba82af2..135fe23b78b0e9de603917de390e4df36cd0d202 100644 (file)
@@ -11,6 +11,8 @@
 
 #include <QGridLayout>
 
+#include <iostream>
+
 ModuleBase_PageWidget::ModuleBase_PageWidget(QWidget* theParent)
 : QFrame(theParent)
 {
@@ -33,12 +35,12 @@ void ModuleBase_PageWidget::placeModelWidget(ModuleBase_ModelWidget* theWidget)
   const int kCol = 0;
   const int kRow = myMainLayout->count();
   myMainLayout->addWidget(theWidget, kRow, kCol);
+  myMainLayout->setRowStretch(kRow, 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
@@ -46,7 +48,8 @@ void ModuleBase_PageWidget::placePageWidget(ModuleBase_PageBase* theWidget)
   }
   const int kCol = 0;
   const int kRow = myMainLayout->count();
-  myMainLayout->addWidget(aWidget, kRow, kCol);//, Qt::AlignTop | Qt::AlignLeft);
+  myMainLayout->addWidget(theWidget, kRow, kCol);
+  myMainLayout->setRowStretch(kRow, 0);
 }
 
 QLayout* ModuleBase_PageWidget::pageLayout()