1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: PartSet_EditLine.h
4 // Created: 02 June 2014
5 // Author: Natalia ERMOLAEVA
7 #include <PartSet_EditLine.h>
11 PartSet_EditLine::PartSet_EditLine(QWidget* theParent)
14 myEditor = new QLineEdit(theParent);
15 myEditor->setWindowFlags(Qt::ToolTip);
16 myEditor->setFocusPolicy(Qt::StrongFocus);
18 connect(myEditor, SIGNAL(returnPressed()), this, SLOT(onStopEditing()));
21 void PartSet_EditLine::start(const QPoint& thePoint, double theValue)
23 myEditor->move(thePoint);
24 myEditor->setText(QString::number(theValue));
27 myEditor->selectAll();
31 bool PartSet_EditLine::isStarted() const
33 return myEditor->isVisible();
36 void PartSet_EditLine::stop()
41 double PartSet_EditLine::getValue() const
43 return myEditor->text().toDouble();
46 void PartSet_EditLine::onStopEditing()
49 emit stopped(getValue());