Salome HOME
Property panel widgets redesign
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetLabel.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        ModuleBase_WidgetLabel.cpp
4 // Created:     03 Dec 2014
5 // Author:      Vitaly SMETANNIKOV
6
7 #include "ModuleBase_WidgetLabel.h"
8
9 #include <Config_WidgetAPI.h>
10 #include <ModuleBase_Tools.h>
11
12 #include <QLabel>
13 #include <QVBoxLayout>
14
15
16 ModuleBase_WidgetLabel::ModuleBase_WidgetLabel(QWidget* theParent,
17                                                const Config_WidgetAPI* theData,
18                                                const std::string& theParentId)
19     : ModuleBase_ModelWidget(theParent, theData, theParentId)
20 {
21   QString aText = QString::fromStdString(theData->getProperty("title"));
22   myLabel = new QLabel(aText, theParent);
23   myLabel->setWordWrap(true);
24   myLabel->setIndent(5);
25   myLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
26   QVBoxLayout* aLayout = new QVBoxLayout(this);
27   ModuleBase_Tools::zeroMargins(aLayout);
28   aLayout->addWidget(myLabel);
29   setLayout(aLayout);
30 }
31
32 ModuleBase_WidgetLabel::~ModuleBase_WidgetLabel()
33 {
34 }
35
36 QList<QWidget*> ModuleBase_WidgetLabel::getControls() const
37 {
38   return QList<QWidget*>();
39 }
40