]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/ModuleBase/ModuleBase_Tools.cpp
Salome HOME
SketchShapePlugin: checked group box/multi editor controls, which highlight the paren...
[modules/shaper.git] / src / ModuleBase / ModuleBase_Tools.cpp
index d33467c7e883cacdbf53e1a68fb6b07c31a90518..66f2979fa4dd03f45a2383900d285b7c89fd4230 100755 (executable)
@@ -29,6 +29,8 @@
 #include <QPainter>
 #include <QBitmap>
 #include <QDoubleSpinBox>
+#include <QGraphicsDropShadowEffect>
+#include <QColor>
 
 #include <sstream>
 
@@ -91,6 +93,23 @@ void setFocus(QWidget* theWidget, const QString& theInfo)
 #endif
 }
 
+void setShadowEffect(QWidget* theWidget, const bool isSetEffect)
+{
+  if (isSetEffect) {
+    QGraphicsDropShadowEffect* aGlowEffect = new QGraphicsDropShadowEffect();
+    aGlowEffect->setOffset(.0);
+    aGlowEffect->setBlurRadius(10.0);
+    aGlowEffect->setColor(QColor(0, 170, 255)); // Light-blue color, #00AAFF
+    theWidget->setGraphicsEffect(aGlowEffect);
+  }
+  else {
+    QGraphicsEffect* anEffect = theWidget->graphicsEffect();
+    if(anEffect)
+    anEffect->deleteLater();
+    theWidget->setGraphicsEffect(NULL);
+  }
+}
+
 QPixmap composite(const QString& theAdditionalIcon, const QString& theIcon)
 {
   QImage anIcon(theIcon);