6 #include "validatoraccepted_p.h"
12 const QStringList ValidatorAcceptedPrivate::trueVals{u
"yes"_qs, u
"on"_qs, u
"1"_qs, u
"true"_qs};
16 :
ValidatorRule(*new ValidatorAcceptedPrivate(field, messages))
50 return c->
qtTrId(
"cutelyst-valaccepted-genvalerr");
54 return c->
qtTrId(
"cutelyst-valaccepted-genvalerr-label").
arg(_label);
QString qtTrId(const char *id, int n=-1) const
ValidatorAccepted(const QString &field, const ValidatorMessages &messages=ValidatorMessages())
QString genericValidationError(Context *c, const QVariant &errorData=QVariant()) const override
~ValidatorAccepted() override
Base class for all validator rules.
QString validationError(Context *c, const QVariant &errorData={}) const
QString label(Context *c) const
QString value(const ParamsMultiMap ¶ms) const
QString debugString(Context *c) const
static bool validate(const QString &value)
Returns true if the value is equal to yes, on, 1, or true.
The Cutelyst namespace holds all public Cutelyst API.
QString arg(Args &&... args) const const
bool isEmpty() const const
void setValue(QVariant &&value)
Stores custom error messages and the input field label.
Contains the result of a single input parameter validation.