Salome HOME
Property panel widgets redesign
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetLabel.cpp
index e5b090be644c03ef47d544c0180eeaea837a170a..3abae6c7b704c9062981fd4ee87f8da1b9b25afc 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
 // File:        ModuleBase_WidgetLabel.cpp
 // Created:     03 Dec 2014
 // Author:      Vitaly SMETANNIKOV
@@ -5,19 +7,26 @@
 #include "ModuleBase_WidgetLabel.h"
 
 #include <Config_WidgetAPI.h>
+#include <ModuleBase_Tools.h>
 
 #include <QLabel>
+#include <QVBoxLayout>
 
 
 ModuleBase_WidgetLabel::ModuleBase_WidgetLabel(QWidget* theParent,
-                                                     const Config_WidgetAPI* theData,
-                                                     const std::string& theParentId)
+                                               const Config_WidgetAPI* theData,
+                                               const std::string& theParentId)
     : ModuleBase_ModelWidget(theParent, theData, theParentId)
 {
   QString aText = QString::fromStdString(theData->getProperty("title"));
   myLabel = new QLabel(aText, theParent);
   myLabel->setWordWrap(true);
   myLabel->setIndent(5);
+  myLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
+  QVBoxLayout* aLayout = new QVBoxLayout(this);
+  ModuleBase_Tools::zeroMargins(aLayout);
+  aLayout->addWidget(myLabel);
+  setLayout(aLayout);
 }
 
 ModuleBase_WidgetLabel::~ModuleBase_WidgetLabel()
@@ -29,7 +38,3 @@ QList<QWidget*> ModuleBase_WidgetLabel::getControls() const
   return QList<QWidget*>();
 }
 
-QWidget* ModuleBase_WidgetLabel::getControl() const
-{
-  return myLabel;
-}