| 229 | } |
| 230 | |
| 231 | QString NumberSpinBox::strip(const QString& t) const { |
| 232 | // Copied from QAbstractSpinBox.cpp |
| 233 | QStringView text(t); |
| 234 | |
| 235 | int size = text.size(); |
| 236 | const QString p = prefix(); |
| 237 | const QString s = suffix(); |
| 238 | bool changed = false; |
| 239 | int from = 0; |
| 240 | if (p.size() && text.startsWith(p)) { |
| 241 | from += p.size(); |
| 242 | size -= from; |
| 243 | changed = true; |
| 244 | } |
| 245 | if (s.size() && text.endsWith(s)) { |
| 246 | size -= s.size(); |
| 247 | changed = true; |
| 248 | } |
| 249 | if (changed) |
| 250 | text = text.mid(from, size); |
| 251 | text = text.trimmed(); |
| 252 | return text.toString(); |
| 253 | } |
| 254 | |
| 255 | QString NumberSpinBox::textFromValue(double value) const { |
| 256 | Q_UNUSED(value); |