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_WidgetDoubleValue.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_WidgetDoubleValue
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,
30 const std::string& theParentId);
32 /// \theParent the parent object
33 /// \theParent the parent object
34 /// \theData the widget configuation. The attribute of the model widget is obtained from
35 ModuleBase_WidgetEditor(QWidget* theParent, const std::string& theAttribute);
38 virtual ~ModuleBase_WidgetEditor();
40 /// Set focus to the first control of the current widget. The focus policy of the control is checked.
41 /// If the widget has the NonFocus focus policy, it is skipped.
42 /// \return the state whether the widget can accept the focus
43 virtual bool focusTo();
45 /// Creates an editor for the real value and set the new value to the feature
46 /// \param theFeature the model feature
47 /// \param theAttribute the feature attribute
48 static void editFeatureValue(FeaturePtr theFeature, const std::string theAttribute);
51 /// Shous popup window under cursor for data editing
52 void showPopupEditor();
55 FeaturePtr myFeature; ///< the current widget feature
56 QStringList myFeatureKinds; ///< the kinds of possible features