1 // File: ModuleBase_WidgetPoint2D.h
2 // Created: 25 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef ModuleBase_WidgetPoint2D_H
6 #define ModuleBase_WidgetPoint2D_H
8 #include <ModuleBase.h>
9 #include "ModuleBase_ModelWidget.h"
13 class ModelAPI_Feature;
18 /**\class ModuleBase_WidgetPoint2D
20 * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls
22 class MODULEBASE_EXPORT ModuleBase_WidgetPoint2D : public ModuleBase_ModelWidget
27 /// \theParent the parent object
28 /// \theParent the parent object
29 /// \theData the widget configuation. The attribute of the model widget is obtained from
30 ModuleBase_WidgetPoint2D(QWidget* theParent, const Config_WidgetAPI* theData);
32 virtual ~ModuleBase_WidgetPoint2D();
34 /// Saves the internal parameters to the given feature
35 /// \param theFeature a model feature to be changed
36 virtual bool storeValue(FeaturePtr theFeature) const;
38 virtual bool restoreValue(FeaturePtr theFeature);
40 /// Returns the internal parent wiget control, that can be shown anywhere
41 /// \returns the widget
42 QWidget* getControl() const;
44 /// Returns list of widget controls
45 /// \return a control list
46 virtual QList<QWidget*> getControls() const;
48 /// Process key release envent on the widget spin box controls
49 /// \param theObject the object where the event happens
50 /// \param theEvent the processed event
51 virtual bool eventFilter(QObject *theObject, QEvent *theEvent);
54 QGroupBox* myGroupBox; ///< the parent group box for all intenal widgets
55 QDoubleSpinBox* myXSpin; ///< the spin box for the X coordinate
56 QDoubleSpinBox* myYSpin; ///< the spin box for the Y coordinate