#include <QLineEdit>
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()));
}
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
void PartSet_EditLine::onStopEditing()
{
- myEditor->hide();
+ stop();
emit stopped(getValue());
}