X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_PageWidget.cpp;h=1fbcf01e5d6cc574bf12118a47cbdd6b80144e8f;hb=0f31b19c1a4208e3021259ccba85889a7a29add5;hp=d3039cac5b12dcb8988409d01083463fc4bf62a3;hpb=2727f05d03a3971bdb389ed0b4a237e8ce40d0d7;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_PageWidget.cpp b/src/ModuleBase/ModuleBase_PageWidget.cpp index d3039cac5..1fbcf01e5 100644 --- a/src/ModuleBase/ModuleBase_PageWidget.cpp +++ b/src/ModuleBase/ModuleBase_PageWidget.cpp @@ -1,20 +1,34 @@ -/* - * ModuleBase_PageWidget.cpp - * - * Created on: Mar 4, 2015 - * Author: sbh - */ +// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #include #include #include -#include +#include + +#include ModuleBase_PageWidget::ModuleBase_PageWidget(QWidget* theParent) : QFrame(theParent) { - myMainLayout = new QGridLayout(this); + myMainLayout = new QVBoxLayout(this); ModuleBase_Tools::adjustMargins(myMainLayout); setLayout(myMainLayout); } @@ -25,30 +39,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->setRowStretch(kRow, 0); + myMainLayout->addWidget(theWidget, 0); } -void ModuleBase_PageWidget::placePageWidget(ModuleBase_PageBase* theWidget) +void ModuleBase_PageWidget::placeWidget(QWidget* theWidget) { - QWidget* aWidget = dynamic_cast(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); - myMainLayout->setRowStretch(kRow, 0); + myMainLayout->addWidget(theWidget, 0); } QLayout* ModuleBase_PageWidget::pageLayout()