Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / PartSet / PartSet_EditLine.h
1 // File:        PartSet_EditLine.h
2 // Created:     02 Jun 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef PartSet_EditLine_H
6 #define PartSet_EditLine_H
7
8 #include "PartSet.h"
9
10 #include <QObject>
11 #include <QPoint>
12
13 class QLineEdit;
14 class QWidget;
15
16 /*!
17  \class PartSet_EditLine
18  * \brief The class to give an editor to modify a real value
19  */
20 class PARTSET_EXPORT PartSet_EditLine : public QObject
21 {
22 Q_OBJECT
23  public:
24   /// Constructor
25   PartSet_EditLine(QWidget* theParent);
26   /// Destructor
27   virtual ~PartSet_EditLine()
28   {
29   }
30   ;
31
32   /// Show the editor in the given global position
33   /// \param thePoint a position
34   /// \param theValue a value for the editor
35   void start(const QPoint& thePoint, double theValue);
36
37   /// Checks whether the editor is started
38   /// \returns true if the editor is activated
39   bool isStarted() const;
40
41   /// Stop the editor, in other words hide it
42   void stop();
43
44 signals:
45   /// Signals about the editing stop
46   /// \param theValue the editor value
47   void stopped(double theValue);
48
49  protected:
50   /// Returns the editor value
51   /// \return the real value
52   double getValue() const;
53
54  protected slots:
55   /// Slot to check the editing stop
56   void onStopEditing();
57
58  protected:
59   QLineEdit* myEditor;  /// the value editor
60 };
61
62 #endif