Core: workaround for Building US unit system bug (#25288)

* Core: workaround for Building US unit system bug

Fixes #11345

This workaround should hopefully fix the Building US unit system bug at the level of the InputField code. This is the most feasible solution given that we are currently in the v1.1 feature freeze.

I use the word "hopefully" because I have not compiled and tested the code. But replacing `+` with `--` works in Python examples.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix typo in comment

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Roy-043
2025-11-14 19:58:24 +01:00
committed by GitHub
parent 0083364dbe
commit c422404020

View File

@@ -769,6 +769,12 @@ void InputField::fixup(QString& input) const
if (localePlus != asciiPlus) {
input.replace(localePlus, asciiPlus);
}
// workaround for improper handling of plus sign
// in Building US unit system
// https://github.com/FreeCAD/FreeCAD/issues/11345
QString asciiMinusMinus(QStringLiteral("--"));
input.replace(asciiPlus, asciiMinusMinus);
}
QValidator::State InputField::validate(QString& input, int& pos) const