mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-09-28 04:54:13 +02:00
5dbb9f28de
Address feedback on the width/height/depth elementInformation fields: - The regex accepted "." alone as a complete value ([0-9]* permits zero digits on both sides), meaning a field could be committed with a literal "." saved to the XML. Require at least one digit either before or after the separator. - The same pattern was duplicated verbatim in elementinfopartwidget.cpp and elementpropertieseditorwidget.cpp's EditorDelegate. Factored into QETInformation::numericInfoPattern(), a single shared definition both call sites now use. - Tightened the pattern to at most 2 decimal places (down from 4) to match the precision actually meaningful for these fields. Not changed, by design: - Storage stays a plain string, consistent with every other numeric elementInformation field (quantity etc.) in this codebase -- values round-trip through XML text regardless, so a long/micron representation wouldn't avoid the string<->number conversion, only relocate it. - No decimal-comma normalization needed: with the fixed pattern, only digits and "." are ever accepted at the keystroke level, so an alternate separator can't enter the field in the first place.