1 // File: PartSet_EditLine.h
2 // Created: 02 June 2014
3 // Author: Natalia ERMOLAEVA
5 #include <PartSet_EditLine.h>
9 PartSet_EditLine::PartSet_EditLine(QWidget* theParent)
12 myEditor = new QLineEdit(theParent);
13 myEditor->setWindowFlags(Qt::ToolTip);
14 myEditor->setFocusPolicy(Qt::StrongFocus);
16 connect(myEditor, SIGNAL(returnPressed()), this, SLOT(onStopEditing()));
19 void PartSet_EditLine::start(const QPoint& thePoint, double theValue)
21 myEditor->move(thePoint);
22 myEditor->setText(QString::number(theValue));
25 myEditor->selectAll();
29 bool PartSet_EditLine::isStarted() const
31 return myEditor->isVisible();
34 void PartSet_EditLine::stop()
39 double PartSet_EditLine::getValue() const
41 return myEditor->text().toDouble();
44 void PartSet_EditLine::onStopEditing()
47 emit stopped(getValue());