Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom into Dev_1.1.0
authornds <natalia.donis@opencascade.com>
Fri, 27 Feb 2015 12:41:47 +0000 (15:41 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 27 Feb 2015 12:41:47 +0000 (15:41 +0300)
1  2 
src/ModuleBase/ModuleBase_WidgetShapeSelector.cpp

index 30787899f28139e6146833f6afbc4ebad2bc6cbb,7ff59204e62f06c6ac5eb34640419e40dd0e2fc8..093780bae232376dc2e313ed373f9fa37b5708e4
@@@ -55,6 -55,7 +55,7 @@@
  #include <QEvent>
  #include <QDockWidget>
  #include <QApplication>
+ #include <QFormLayout>
  
  #include <TopExp_Explorer.hxx>
  #include <TopoDS_Shape.hxx>
@@@ -95,25 -96,23 +96,23 @@@ ModuleBase_WidgetShapeSelector::ModuleB
      : ModuleBase_ModelWidget(theParent, theData, theParentId),
        myWorkshop(theWorkshop), myIsActive(false)
  {
-   myContainer = new QWidget(theParent);
-   QHBoxLayout* aLayout = new QHBoxLayout(myContainer);
+   QFormLayout* aLayout = new QFormLayout(this);
    ModuleBase_Tools::adjustMargins(aLayout);
  
    QString aLabelText = QString::fromStdString(theData->widgetLabel());
    QString aLabelIcon = QString::fromStdString(theData->widgetIcon());
-   myLabel = new QLabel(aLabelText, myContainer);
+   myLabel = new QLabel(aLabelText, this);
    if (!aLabelIcon.isEmpty())
      myLabel->setPixmap(QPixmap(aLabelIcon));
  
-   aLayout->addWidget(myLabel);
  
    QString aToolTip = QString::fromStdString(theData->widgetTooltip());
-   myTextLine = new QLineEdit(myContainer);
+   myTextLine = new QLineEdit(this);
    myTextLine->setReadOnly(true);
    myTextLine->setToolTip(aToolTip);
    myTextLine->installEventFilter(this);
  
-   aLayout->addWidget(myTextLine, 1);
+   aLayout->addRow(myLabel, myTextLine);
  
    std::string aTypes = theData->getProperty("shape_types");
    myShapeTypes = QString(aTypes.c_str()).split(' ', QString::SkipEmptyParts);
@@@ -466,7 -465,7 +465,7 @@@ void ModuleBase_WidgetShapeSelector::se
  //********************************************************************
  void ModuleBase_WidgetShapeSelector::raisePanel() const
  {
-   QWidget* aParent = myContainer->parentWidget();
+   QWidget* aParent = this->parentWidget();
    QWidget* aLastPanel = 0;
    while (!aParent->inherits("QDockWidget")) {
      aLastPanel = aParent;
@@@ -535,11 -534,11 +534,11 @@@ bool ModuleBase_WidgetShapeSelector::is
        if (aShapeValidator) {
          DataPtr aData = myFeature->data();
          AttributeSelectionPtr aSelectAttr = aData->selection(attributeID());
 -        if (!aShapeValidator->isValid(myFeature, aSelectAttr, theShape)) {
 +        if (!aShapeValidator->isValid(myFeature, *aArgs, theObj, aSelectAttr, theShape)) {
            return false;
          }
        }
      }
    }
    return true;
- }
+ }