mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-03 17:34:12 +02:00
Reject trailing-dot input like "12." in numeric elementInformation fields
numericInfoPattern()'s integer branch no longer allows an optional trailing ".", so "12." is now Intermediate rather than Acceptable -- already-built hasAcceptableInput() guard then keeps it from being stored, same as a lone ".". Previously it validated fine and got saved verbatim, silently freezing in that form since nothing ever normalized it afterward.
This commit is contained in:
@@ -225,7 +225,7 @@ QString QETInformation::elementInfoToVar(const QString &info)
|
|||||||
*/
|
*/
|
||||||
QRegularExpression QETInformation::numericInfoPattern()
|
QRegularExpression QETInformation::numericInfoPattern()
|
||||||
{
|
{
|
||||||
return QRegularExpression(QStringLiteral(R"(^[0-9]+\.?[0-9]{0,2}$|^[0-9]*\.[0-9]{1,2}$)"));
|
return QRegularExpression(QStringLiteral(R"(^[0-9]+$|^[0-9]*\.[0-9]{1,2}$)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user