WSpinBox::WSpinBox(WContainerWidget *parent) : WAbstractSpinBox(parent), value_(-1), min_(0), max_(99), step_(1) { setValidator(createValidator()); setValue(0); }
WDoubleSpinBox::WDoubleSpinBox(WContainerWidget *parent) : WAbstractSpinBox(parent), value_(-1), min_(0.0), max_(99.99), step_(1.0), precision_(2) { setValidator(createValidator()); setValue(0.0); }
void XmlParserTest::initTestCase() { try { // Create a validator validator = createValidator(QStringLiteral(":/courses/course.xsd")); } catch (Exception& e) { QFAIL(qUtf8Printable(e.message())); } }
WSpinBox::WSpinBox(WContainerWidget *parent) : WAbstractSpinBox(parent), value_(-1), min_(0), max_(99), step_(1), wrapAroundEnabled_(false), valueChanged_(this) { setValidator(createValidator()); setValue(0); }
void WAbstractSpinBox::updateDom(DomElement& element, bool all) { if (all || changed_) { if (!all) { if (!nativeControl()) doJavaScript("jQuery.data(" + jsRef() + ", 'obj')" ".update(" + jsMinMaxStep() + "," + boost::lexical_cast<std::string>(decimals()) + ");"); else setValidator(createValidator()); } } changed_ = false; WLineEdit::updateDom(element, all); if (all && nativeControl()) element.setAttribute("type", "number"); }
void WAbstractSpinBox::updateDom(DomElement& element, bool all) { if (all || changed_) { if (!all) { if (!nativeControl()) doJavaScript("jQuery.data(" + jsRef() + ", 'obj')" ".configure(" + std::to_string(decimals()) + "," + prefix().jsStringLiteral() + "," + suffix().jsStringLiteral() + "," + jsMinMaxStep() + ");"); else setValidator(std::shared_ptr<WValidator>(createValidator().release())); } } changed_ = false; WLineEdit::updateDom(element, all); if (all && nativeControl()) element.setAttribute("type", "number"); }
void WAbstractSpinBox::setup(bool useNative) { if (useNative) { setValidator(createValidator()); } else { defineJavaScript(); addStyleClass("Wt-spinbox"); #ifdef WT_CNOR EventSignalBase& b = mouseMoved(); EventSignalBase& c = keyWentDown(); #endif connectJavaScript(mouseMoved(), "mouseMove"); connectJavaScript(mouseWentUp(), "mouseUp"); connectJavaScript(mouseWentDown(), "mouseDown"); connectJavaScript(mouseWentOut(), "mouseOut"); connectJavaScript(keyWentDown(), "keyDown"); connectJavaScript(keyWentUp(), "keyUp"); setValidator(new SpinBoxValidator(this)); } }
void XmlParserTest::invalidSchemaFile() { QVERIFY_EXCEPTION_THROWN(createValidator(QStringLiteral(":/testing/courses/testcourse.xml")), XmlException); }
void XmlParserTest::invalidSchemaFilePath() { QVERIFY_EXCEPTION_THROWN(createValidator(QStringLiteral(":/testing/courses/FOOBAR.xsd")), FileException); }
void IndirectSpectrumSelectionView::setMaskBinsRegex(const std::string ®ex) { m_selector->leMaskBins->setValidator( createValidator(QString::fromStdString(regex))); }