X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPartSet%2FPartSet_EditLine.cpp;h=a7b2ecccb9b1ebfc5f5cf5cff91604c4c3068d5d;hb=7d7c82a40c584a3004bdbf41df431ba7c0b7eb4c;hp=4d8e7e9d8a6c15e753f78451e37fa86875da15ed;hpb=b3eb2ec99597987ae45f7b0f8edafb03a6cae129;p=modules%2Fshaper.git diff --git a/src/PartSet/PartSet_EditLine.cpp b/src/PartSet/PartSet_EditLine.cpp index 4d8e7e9d8..a7b2ecccb 100644 --- a/src/PartSet/PartSet_EditLine.cpp +++ b/src/PartSet/PartSet_EditLine.cpp @@ -7,9 +7,11 @@ #include PartSet_EditLine::PartSet_EditLine(QWidget* theParent) -: QObject(theParent) + : QObject(theParent) { myEditor = new QLineEdit(theParent); + myEditor->setWindowFlags(Qt::ToolTip); + myEditor->setFocusPolicy(Qt::StrongFocus); connect(myEditor, SIGNAL(returnPressed()), this, SLOT(onStopEditing())); } @@ -19,6 +21,19 @@ void PartSet_EditLine::start(const QPoint& thePoint, double theValue) myEditor->move(thePoint); myEditor->setText(QString::number(theValue)); myEditor->show(); + + myEditor->selectAll(); + myEditor->setFocus(); +} + +bool PartSet_EditLine::isStarted() const +{ + return myEditor->isVisible(); +} + +void PartSet_EditLine::stop() +{ + myEditor->hide(); } double PartSet_EditLine::getValue() const @@ -28,6 +43,6 @@ double PartSet_EditLine::getValue() const void PartSet_EditLine::onStopEditing() { - myEditor->hide(); + stop(); emit stopped(getValue()); }