MCPcopy Create free account
hub / github.com/PlotJuggler/PlotJuggler / commitText

Method commitText

pj_widgets/src/DoubleScrubber.cpp:77–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77bool DoubleScrubber::commitText(const QString& text) {
78 QString stripped = text;
79 if (!prefix_.isEmpty() && stripped.startsWith(prefix_)) {
80 stripped = stripped.mid(prefix_.size());
81 }
82 if (!suffix_.isEmpty() && stripped.endsWith(suffix_)) {
83 stripped.chop(suffix_.size());
84 }
85 bool ok = false;
86 const double parsed = stripped.trimmed().toDouble(&ok);
87 if (!ok) {
88 return false;
89 }
90 setValue(parsed);
91 return true;
92}
93
94} // namespace PJ

Callers

nothing calls this directly

Calls 3

toDoubleMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected