Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetLineEdit.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 /*
4  * ModuleBase_WidgetLineEdit.h
5  *
6  *  Created on: Oct 8, 2014
7  *      Author: sbh
8  */
9
10 #ifndef MODULEBASE_WIDGETLINEEDIT_H_
11 #define MODULEBASE_WIDGETLINEEDIT_H_
12
13 #include <ModuleBase.h>
14 #include <ModuleBase_ModelWidget.h>
15
16 #include <QList>
17 #include <QString>
18 #include <QStringList>
19
20 class QWidget;
21 class QLineEdit;
22
23 /**
24 * Implementation of model widget for line edit widget.
25 * It can be defined with "stringvalue" keyword.
26 */
27 class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidget
28 {
29   Q_OBJECT
30  public:
31   /// Constructor
32   /// \param theParent the parent object
33   /// \param theData the widget configuation. The attribute of the model widget is obtained from
34   /// \param theParentId is Id of a parent of the current attribute
35   ModuleBase_WidgetLineEdit(QWidget* theParent,
36                                 const Config_WidgetAPI* theData,
37                                 const std::string& theParentId);
38   virtual ~ModuleBase_WidgetLineEdit();
39
40   virtual bool storeValue() const;
41
42   virtual bool restoreValue();
43
44   QWidget* getControl() const;
45
46   virtual QList<QWidget*> getControls() const;
47
48  public slots:
49    /// A slot for processing text changed event
50   void onTextChanged();
51
52  private:
53    /// A line edit control
54   QLineEdit* myLineEdit;
55
56   /// A container widget
57   QWidget* myMainWidget;
58 };
59
60 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */