1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_WidgetEditor.h
4 // Created: 25 Apr 2014
5 // Author: Natalia ERMOLAEVA
7 #ifndef ModuleBase_WidgetEditor_H
8 #define ModuleBase_WidgetEditor_H
10 #include <ModuleBase.h>
11 #include "ModuleBase_WidgetDoubleValue.h"
14 #include <QStringList>
16 class ModelAPI_Feature;
19 /**\class ModuleBase_WidgetEditor
21 * \brief Custom widget. An abstract class to be redefined to fill with some GUI controls
23 class MODULEBASE_EXPORT ModuleBase_WidgetEditor : public ModuleBase_WidgetDoubleValue
28 /// \param theParent the parent object
29 /// \param theData the widget configuation. The attribute of the model widget is obtained from
30 /// \param theParentId is Id of a parent of the current attribute
31 ModuleBase_WidgetEditor(QWidget* theParent, const Config_WidgetAPI* theData,
32 const std::string& theParentId);
34 /// \param theParent the parent object
35 /// \param theAttribute The attribute of the model widget
36 ModuleBase_WidgetEditor(QWidget* theParent, const std::string& theAttribute);
39 virtual ~ModuleBase_WidgetEditor();
41 /// Set focus to the first control of the current widget. The focus policy of the control is checked.
42 /// If the widget has the NonFocus focus policy, it is skipped.
43 /// \return the state whether the widget can accept the focus
44 virtual bool focusTo();
46 /// Creates an editor for the real value and set the new value to the feature
47 /// \param theFeature the model feature
48 /// \param theAttribute the feature attribute
49 static void editFeatureValue(FeaturePtr theFeature, const std::string theAttribute);
52 /// Shous popup window under cursor for data editing
53 void showPopupEditor();
56 ///< the current widget feature
59 ///< the kinds of possible features
60 QStringList myFeatureKinds;