MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / create

Function create

src/gui/util_gui.cpp:289–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287#endif
288
289 QSpinBox* create(int min, int max, const QString &unit, int step)
290 {
291 auto box = new QSpinBox();
292 box->setRange(min, max);
293 const auto space = QLatin1Char{' '};
294 if (unit.startsWith(space))
295 box->setSuffix(unit);
296 else if (unit.length() > 0)
297 box->setSuffix(space + unit);
298 if (step > 0)
299 box->setSingleStep(step);
300#ifndef NDEBUG
301 if (countDigits(min, box->locale()) > max_digits())
302 qWarning("Util::SpinBox::create() will create "
303 "a very large widget because of min=%s",
304 QByteArray::number(min).constData());
305 if (countDigits(max, box->locale()) > max_digits())
306 qWarning("Util::SpinBox::create() will create "
307 "a very large widget because of max=%s",
308 QByteArray::number(max).constData());
309#endif
310 return box;
311 }
312
313 QDoubleSpinBox* create(int decimals, double min, double max, const QString &unit, double step)
314 {

Callers 1

createMethod · 0.70

Calls 3

countDigitsFunction · 0.85
max_digitsFunction · 0.85
lengthMethod · 0.45

Tested by

no test coverage detected