Salome HOME
Issue #1505 Bug in parameters management (with parts not loaded)
[modules/shaper.git] / src / ModuleBase / ModuleBase_ModelWidget.h
index def9a3fcb8ae65df33dbac398610d45de9ef0497..c21ef7e8a294424d050639b0321b3aea7337b956 100644 (file)
@@ -43,7 +43,7 @@ Q_OBJECT
   /// Constructor
   /// \param theParent the parent object
   /// \param theData the widget configuration. The attribute of the model widget is obtained from
-  /// \param theData a low-level API for reading xml definitions of widgets
+  /// a low-level API for reading xml definitions of widgets
   ModuleBase_ModelWidget(QWidget* theParent, const Config_WidgetAPI* theData);
   /// Destructor
   virtual ~ModuleBase_ModelWidget()
@@ -85,6 +85,9 @@ Q_OBJECT
   /// \return the enumeration result
   ValueState getValueState() const { return myState; }
 
+  /// Stores the widget value if it is modified
+  void processValueState();
+
   /// Returns an attribute error according to the value state
   /// It exists in all cases excepring the "Store" case
   QString getValueStateError() const;
@@ -98,8 +101,9 @@ Q_OBJECT
 
   //! Returns the widget error, get it from the attribute validator and state of the widget
   //! If the feature is correct, it returns an empty value
+  //! \param theValueStateChecked the boolean flag if the state of the widget should be checked
   //! \return string value
-  QString getError() const;
+  QString getError(const bool theValueStateChecked = true) const;
 
   /// Set the given wrapped value to the current widget
   /// This value should be processed in the widget according to the needs
@@ -180,7 +184,9 @@ Q_OBJECT
   /// Set feature which is processing by active operation
   /// \param theFeature a feature object
   /// \param theToStoreValue a value about necessity to store the widget value to the feature
-  void setFeature(const FeaturePtr& theFeature, const bool theToStoreValue = false);
+  /// \param isUpdateFlushed a flag if update should be flushed on store value
+  void setFeature(const FeaturePtr& theFeature, const bool theToStoreValue = false,
+                  const bool isUpdateFlushed = true);
 
   /// Editing mode depends on mode of current operation. This value is defined by it.
   virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; }
@@ -288,7 +294,8 @@ protected slots:
   void onWidgetValuesModified();
 
  protected:
-   ModuleBase_WidgetValidator* myWidgetValidator; /// own validator, by default it is zero
+    /// own validator, by default it is zero
+   ModuleBase_WidgetValidator* myWidgetValidator;
 
   /// The attribute name of the model feature
   std::string myAttributeID;
@@ -320,6 +327,8 @@ private:
   bool myUseReset;
   /// blocked flag of modification of the value state
   bool myIsValueStateBlocked;
+  /// do not flush updated signal
+  bool myFlushUpdateBlocked;
 };
 
 #endif