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

Method updateText

src/Gui/InputField.cpp:174–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172}
173
174void InputField::updateText(const Base::Quantity& quant)
175{
176 if (isBound()) {
177 std::shared_ptr<const Expression> e(
178 getPath().getDocumentObject()->getExpression(getPath()).expression
179 );
180
181 if (e) {
182 setText(QString::fromStdString(e->toString()));
183 return;
184 }
185 }
186
187 double dFactor;
188 std::string unitStr;
189 std::string txt = quant.getUserString(dFactor, unitStr);
190 actUnitValue = quant.getValue() / dFactor;
191 // Block signals to prevent newInput from re-parsing the display text
192 // and overwriting actQuantity with a precision-truncated value.
193 QSignalBlocker blocker(this);
194 setText(QString::fromStdString(txt));
195}
196
197void InputField::notifyValueChanged()
198{

Callers

nothing calls this directly

Calls 7

getDocumentObjectMethod · 0.80
isBoundFunction · 0.50
getPathFunction · 0.50
getExpressionMethod · 0.45
toStringMethod · 0.45
getUserStringMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected