Salome HOME
Abort Sketch by click on the button in the tool bar. Abort nested opened operations.
[modules/shaper.git] / src / ModuleBase / ModuleBase_ModelWidget.cpp
index 2085e690202290fa5c6e6457f5bccaa6d4587ee5..130e8940476f581a582483dffa5778fbacc0968d 100644 (file)
@@ -20,6 +20,7 @@
 #include <QGraphicsDropShadowEffect>
 #include <QColor>
 #include <QLabel>
+#include <QFocusEvent>
 
 ModuleBase_ModelWidget::ModuleBase_ModelWidget(QWidget* theParent,
                                                const Config_WidgetAPI* theData,
@@ -123,6 +124,11 @@ void ModuleBase_ModelWidget::activate()
   activateCustom();
 }
 
+void ModuleBase_ModelWidget::setDefaultValue(const std::string& theValue)
+{
+  myDefaultValue = theValue;
+}
+
 bool ModuleBase_ModelWidget::storeValue()
 {
   emit beforeValuesChanged();
@@ -150,6 +156,11 @@ bool ModuleBase_ModelWidget::eventFilter(QObject* theObject, QEvent *theEvent)
 {
   QWidget* aWidget = qobject_cast<QWidget*>(theObject);
   if (theEvent->type() == QEvent::FocusIn) {
+    #ifdef _DEBUG
+    // The following two lines are for debugging purpose only
+    QFocusEvent* aFocusEvent = dynamic_cast<QFocusEvent*>(theEvent);
+    bool isWinFocus = aFocusEvent->reason() == Qt::ActiveWindowFocusReason;
+    #endif
     if (getControls().contains(aWidget)) {
       emit focusInWidget(this);
     }