Salome HOME
Init feature by model widget factory content
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetPoint2D.h
index c544b6c168f8de9bdbc934295bc610568c14dfb2..bb0f7c84dbfa966a76577a623ae8bdefb43793ca 100644 (file)
@@ -25,26 +25,18 @@ class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_ModelWidget
 public:
   /// Constructor
   /// \theParent the parent object
-  /// \theTitle the group box title
-  /// \theFeatureAttributeID the identifier of the feature attribute
-  ModuleBase_WidgetPoint2D(QWidget* theParent, QString theTitle,
-                           const std::string& theFeatureAttributeID);
+  /// \theParent the parent object
+  /// \theData the widget configuation. The attribute of the model widget is obtained from
+  ModuleBase_WidgetPoint2D(QWidget* theParent, const Config_WidgetAPI* theData);
   /// Destructor
   virtual ~ModuleBase_WidgetPoint2D();
 
   /// Saves the internal parameters to the given feature
   /// \param theFeature a model feature to be changed
-  virtual bool storeValue(FeaturePtr theFeature);
+  virtual bool storeValue(FeaturePtr theFeature) const;
 
   virtual bool restoreValue(FeaturePtr theFeature);
 
-  /// Returns whether the widget can accept focus, or if it corresponds to the given attribute
-  /// \param theAttribute name
-  virtual bool canFocusTo(const std::string& theAttributeName);
-
-  /// Set focus to the current widget if it corresponds to the given attribute
-  virtual void focusTo();
-
   /// Returns the internal parent wiget control, that can be shown anywhere
   /// \returns the widget
   QWidget* getControl() const;
@@ -53,10 +45,12 @@ public:
   /// \return a control list
   virtual QList<QWidget*> getControls() const;
 
+  /// Process key release envent on the widget spin box controls
+  /// \param theObject the object where the event happens
+  /// \param theEvent the processed event
   virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
 
 private:
-  std::string myFeatureAttributeID; ///< the identifier of the feature attribute
   QGroupBox* myGroupBox; ///< the parent group box for all intenal widgets
   QDoubleSpinBox* myXSpin; ///< the spin box for the X coordinate
   QDoubleSpinBox* myYSpin; ///< the spin box for the Y coordinate