1 // File: ModuleBase_WidgetEditor.h
2 // Created: 25 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef ModuleBase_WidgetEditor_H
6 #define ModuleBase_WidgetEditor_H
8 #include <ModuleBase.h>
9 #include "ModuleBase_ModelWidget.h"
12 #include <QStringList>
14 class ModelAPI_Feature;
17 /**\class ModuleBase_WidgetEditor
19 * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls
21 class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_ModelWidget
26 /// \theParent the parent object
27 /// \theParent the parent object
28 /// \theData the widget configuation. The attribute of the model widget is obtained from
29 ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData);
31 virtual ~ModuleBase_WidgetEditor();
33 /// Saves the internal parameters to the given feature
34 /// \param theFeature a model feature to be changed
35 virtual bool storeValue(FeaturePtr theFeature) const;
37 virtual bool restoreValue(FeaturePtr theFeature);
39 /// Set focus to the first control of the current widget. The focus policy of the control is checked.
40 /// If the widget has the NonFocus focus policy, it is skipped.
41 virtual void focusTo();
43 /// Returns the internal parent wiget control, that can be shown anywhere
44 /// \returns the widget
45 QWidget* getControl() const;
47 /// Returns list of widget controls
48 /// \return a control list
49 virtual QList<QWidget*> getControls() const;
52 FeaturePtr myFeature; ///< the current widget feature
53 QStringList myFeatureKinds; ///< the kinds of possible features