- QObject::connect(anEditor, SIGNAL(editingFinished()), &aDlg, SLOT(accept()));
-
- aDlg.move(QCursor::pos());
- aDlg.exec();
-
- if (!myIsEditing) {
- disconnect(anEditor, SIGNAL(keyReleased(QKeyEvent*)), this, SLOT(onKeyReleased(QKeyEvent*)));
- }
-
- outText = anEditor->text();
- bool isDouble;
- double aValue = outText.toDouble(&isDouble);
- if (isDouble) {
- outValue = aValue;
- outText = ""; // return empty string, if it's can be converted to a double
+ QObject::connect(anEditor, SIGNAL(enterReleased()), &aDlg, SLOT(accept()));
+
+ QPoint aPoint = QCursor::pos();
+ if (myXPosition >= 0 && myYPosition >= 0)
+ aPoint = QPoint(myXPosition, myYPosition);
+
+ aDlg.move(aPoint);
+ isValueAccepted = aDlg.exec() == QDialog::Accepted;
+ if (isValueAccepted) {
+ outText = anEditor->text();
+ bool isDouble;
+ double aValue = outText.toDouble(&isDouble);
+ if (isDouble) {
+ outValue = aValue;
+ outText = ""; // return empty string, if it's can be converted to a double
+ }