Salome HOME
e1e41ecd186ca107ae1bdaf75b48bac3bc99f1a8
[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 : ModuleBase_ModelWidget(theParent, theData)
19 {
20   QString aText = QString::fromStdString(theData->getProperty("title"));
21   myLabel = new QLabel(aText, theParent);
22   myLabel->setWordWrap(true);
23   myLabel->setIndent(5);
24   myLabel->setAlignment(Qt::AlignLeft | Qt::AlignTop);
25   QVBoxLayout* aLayout = new QVBoxLayout(this);
26   ModuleBase_Tools::zeroMargins(aLayout);
27   aLayout->addWidget(myLabel);
28   setLayout(aLayout);
29 }
30
31 ModuleBase_WidgetLabel::~ModuleBase_WidgetLabel()
32 {
33 }
34
35 QList<QWidget*> ModuleBase_WidgetLabel::getControls() const
36 {
37   return QList<QWidget*>();
38 }
39