1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetErrorLabel.cpp
4 // Created: 03 Dec 2014
5 // Author: Vitaly SMETANNIKOV
7 #include "ModuleBase_WidgetErrorLabel.h"
9 #include <Config_WidgetAPI.h>
10 #include <ModuleBase_Tools.h>
11 #include <ModelAPI_AttributeString.h>
15 ModuleBase_WidgetErrorLabel::ModuleBase_WidgetErrorLabel(QWidget* theParent,
16 const Config_WidgetAPI* theData,
17 const std::string& theParentId)
18 : ModuleBase_WidgetLabel(theParent, theData, theParentId)
20 myDefaultStyle = myLabel->styleSheet();
23 ModuleBase_WidgetErrorLabel::~ModuleBase_WidgetErrorLabel()
27 bool ModuleBase_WidgetErrorLabel::restoreValueCustom()
29 DataPtr aData = myFeature->data();
30 AttributeStringPtr aStrAttr = aData->string(attributeID());
33 aMsg = aStrAttr->value();
37 myLabel->setStyleSheet(myDefaultStyle);
39 myLabel->setText(aMsg.c_str());
40 myLabel->setStyleSheet("QLabel { background-color : red; color : white; }");