Salome HOME
4d8e7e9d8a6c15e753f78451e37fa86875da15ed
[modules/shaper.git] / src / PartSet / PartSet_EditLine.cpp
1 // File:        PartSet_EditLine.h
2 // Created:     02 June 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #include <PartSet_EditLine.h>
6
7 #include <QLineEdit>
8
9 PartSet_EditLine::PartSet_EditLine(QWidget* theParent)
10 : QObject(theParent)
11 {
12   myEditor = new QLineEdit(theParent);
13
14   connect(myEditor, SIGNAL(returnPressed()), this, SLOT(onStopEditing()));
15 }
16
17 void PartSet_EditLine::start(const QPoint& thePoint, double theValue)
18 {
19   myEditor->move(thePoint);
20   myEditor->setText(QString::number(theValue));
21   myEditor->show();
22 }
23
24 double PartSet_EditLine::getValue() const
25 {
26   return myEditor->text().toDouble();
27 }
28
29 void PartSet_EditLine::onStopEditing()
30 {
31   myEditor->hide();
32   emit stopped(getValue());
33 }