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

Method commitText

pj_widgets/src/IntScrubber.cpp:71–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71bool IntScrubber::commitText(const QString& text) {
72 QString stripped = text;
73 if (!prefix_.isEmpty() && stripped.startsWith(prefix_)) {
74 stripped = stripped.mid(prefix_.size());
75 }
76 if (!suffix_.isEmpty() && stripped.endsWith(suffix_)) {
77 stripped.chop(suffix_.size());
78 }
79 bool ok = false;
80 const int parsed = stripped.trimmed().toInt(&ok);
81 if (!ok) {
82 return false;
83 }
84 setValue(parsed);
85 return true;
86}
87
88} // namespace PJ

Callers

nothing calls this directly

Calls 3

toIntMethod · 0.80
isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected