MCPcopy Create free account
hub / github.com/FreeCAD/FreeCAD / isNormalized

Method isNormalized

src/Gui/QuantitySpinBox.cpp:561–576  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

559}
560
561bool QuantitySpinBox::isNormalized()
562{
563 static const QRegularExpression operators(
564 QStringLiteral("[+\\-/*]"),
565 QRegularExpression::CaseInsensitiveOption
566 );
567
568 Q_D(const QuantitySpinBox);
569
570 // this check is two level
571 // 1. We consider every string that does not contain operators as normalized
572 // 2. If it does contain operators we check if it differs from normalized input - as some
573 // operators like - can be allowed even in normalized case.
574 return !d->validStr.contains(operators)
575 || d->validStr.toStdString() == d->quantity.getUserString();
576}
577
578void QuantitySpinBox::setValue(const Base::Quantity& value)
579{

Callers 1

eventFilterMethod · 0.80

Calls 3

toStdStringMethod · 0.80
containsMethod · 0.45
getUserStringMethod · 0.45

Tested by

no test coverage detected