Salome HOME
Issue #1368: Creation of a Qt panel. Code improvement.
[modules/shaper.git] / src / PartSet / PartSet_WidgetEditor.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        PartSet_WidgetShapeSelector.h
4 // Created:     27 Nov 2014
5 // Author:      Vitaly Smetannikov
6
7
8 #ifndef PartSet_WidgetEditor_H
9 #define PartSet_WidgetEditor_H
10
11 #include "PartSet.h"
12
13 #include <ModuleBase_WidgetEditor.h>
14
15 class ModuleBase_IWorkshop;
16
17 /**
18 * \ingroup Modules
19 * Customization of ModuleBase_WidgetEditor in order to do not show the editor value if the mouse
20 * cursor is not over the OCC window
21 */
22 class PARTSET_EXPORT PartSet_WidgetEditor : public ModuleBase_WidgetEditor
23 {
24 Q_OBJECT
25  public:
26   /// Constructor
27   /// \param theParent the parent object
28   /// \param theWorkshop instance of workshop interface
29   /// \param theData the widget configuration. The attribute of the model widget is obtained from
30   PartSet_WidgetEditor(QWidget* theParent, ModuleBase_IWorkshop* theWorkshop,
31                        const Config_WidgetAPI* theData);
32
33   virtual ~PartSet_WidgetEditor() {}
34
35   /// Activates the editor control only in case if the mouse over the OCC window, otherwise
36   /// set focus to the usual double value control
37   /// \return the state whether the widget can accept the focus
38   virtual bool focusTo();
39
40 private:
41   ModuleBase_IWorkshop* myWorkshop; // the current workshop
42 };
43
44 #endif