X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetErrorLabel.cpp;h=2291bf1a0f9228b4ec7305c65f592543d0601fe4;hb=29dfb8a802f61cacf5f57fb79c62badee00ebcdf;hp=2f8260c91fdb6bb197dae24cc9d807766f6a92db;hpb=f724fd995b85913652a78c734e46b5d34de7e805;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp b/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp index 2f8260c91..2291bf1a0 100644 --- a/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp +++ b/src/ModuleBase/ModuleBase_WidgetErrorLabel.cpp @@ -11,6 +11,7 @@ #include #include +#include ModuleBase_WidgetErrorLabel::ModuleBase_WidgetErrorLabel(QWidget* theParent, const Config_WidgetAPI* theData, @@ -18,6 +19,9 @@ ModuleBase_WidgetErrorLabel::ModuleBase_WidgetErrorLabel(QWidget* theParent, : ModuleBase_WidgetLabel(theParent, theData, theParentId) { myDefaultStyle = myLabel->styleSheet(); + myLabel->setContentsMargins(0,0,0,4); + myLabel->setWordWrap(true); + myLabel->installEventFilter(this); } ModuleBase_WidgetErrorLabel::~ModuleBase_WidgetErrorLabel() @@ -37,7 +41,25 @@ bool ModuleBase_WidgetErrorLabel::restoreValueCustom() myLabel->setStyleSheet(myDefaultStyle); } else { myLabel->setText(aMsg.c_str()); - myLabel->setStyleSheet("QLabel { background-color : red; color : white; }"); + //myLabel->setStyleSheet("QLabel { color : red; font : italic }"); + myLabel->setStyleSheet("QLabel { color : red; font : bold }"); + //myLabel->setStyleSheet("QLabel { border: 1px solid red; }"); } return true; } + + +bool ModuleBase_WidgetErrorLabel::focusTo() +{ + restoreValue(); + return false; +} + +bool ModuleBase_WidgetErrorLabel::eventFilter(QObject* theObj, QEvent* theEvent) +{ + if (theObj == myLabel) { + if (theEvent->type() == QEvent::Show) + restoreValue(); + } + return ModuleBase_WidgetLabel::eventFilter(theObj, theEvent); +}