Salome HOME
Restore old planes selection definition
[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   /// Show the editor in the given global position
30   /// \param thePoint a position
31   /// \param theValue a value for the editor
32   void start(const QPoint& thePoint, double theValue);
33
34   /// Checks whether the editor is started
35   /// \returns true if the editor is activated
36   bool isStarted() const;
37
38   /// Stop the editor, in other words hide it
39   void stop();
40
41 signals:
42   /// Signals about the editing stop
43   /// \param theValue the editor value
44   void stopped(double theValue);
45
46 protected:
47   /// Returns the editor value
48   /// \return the real value
49   double getValue() const;
50
51 protected slots:
52   /// Slot to check the editing stop
53   void onStopEditing();
54
55 protected:
56   QLineEdit* myEditor; /// the value editor
57 };
58
59 #endif