Salome HOME
Issue #1083: errors in parameter
[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 * \ingroup GUI
25 * Implementation of model widget for line edit widget.
26 * It can be defined with "stringvalue" keyword.
27 */
28 class MODULEBASE_EXPORT ModuleBase_WidgetLineEdit : public ModuleBase_ModelWidget
29 {
30   Q_OBJECT
31  public:
32   /// Constructor
33   /// \param theParent the parent object
34   /// \param theData the widget configuration.
35   /// \param theParentId is Id of a parent of the current attribute
36   /// \param thePlaceHolder a string of placeholder
37   ModuleBase_WidgetLineEdit( QWidget* theParent,
38                              const Config_WidgetAPI* theData,
39                              const std::string& theParentId,
40                              const std::string& thePlaceHolder );
41   virtual ~ModuleBase_WidgetLineEdit();
42
43   /// Redefinition of virtual method
44   virtual QList<QWidget*> getControls() const;
45
46   /// Returns true if the event is processed.
47   virtual bool processEnter();
48
49 protected:
50   /// Saves the internal parameters to the given feature
51   /// \return True in success
52   virtual bool storeValueCustom() const;
53
54   /// Redefinition of virtual method
55   virtual bool restoreValueCustom();
56
57 private:
58    /// A line edit control
59   QLineEdit* myLineEdit;
60 };
61
62 #endif /* MODULEBASE_WIDGETFILESELECTOR_H_ */