44 if (Q_UNLIKELY(!ok)) {
46 qCWarning(C_VALIDATOR).noquote().nospace()
48 <<
"\" into an integer number";
50 const qlonglong min = d->extractLongLong(c, params, d->min, &ok);
51 if (Q_UNLIKELY(!ok)) {
53 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
54 qCWarning(C_VALIDATOR).noquote()
55 <<
"Invalid mininum comparison value:" << d->min;
57 const qlonglong max = d->extractLongLong(c, params, d->max, &ok);
58 if (Q_UNLIKELY(!ok)) {
60 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
61 qCWarning(C_VALIDATOR).noquote()
62 <<
"Invalid maximum comparison value:" << d->max;
64 if ((val < min) || (val > max)) {
67 QVariantMap{{QStringLiteral(
"val"), val},
68 {QStringLiteral(
"min"), min},
69 {QStringLiteral(
"max"), max}});
70 qCDebug(C_VALIDATOR).noquote()
71 <<
debugString(c) << val <<
"is not between" << min <<
"and" << max;
86 if (Q_UNLIKELY(!ok)) {
88 qCWarning(C_VALIDATOR).noquote().nospace()
90 <<
"\" into an unsigned integer number";
92 const qulonglong min = d->extractULongLong(c, params, d->min, &ok);
93 if (Q_UNLIKELY(!ok)) {
95 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
96 qCWarning(C_VALIDATOR).noquote()
97 <<
debugString(c) <<
"Invalid mininum comparison value:" << d->min;
99 const qulonglong max = d->extractULongLong(c, params, d->max, &ok);
100 if (Q_UNLIKELY(!ok)) {
102 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
103 qCWarning(C_VALIDATOR).noquote()
104 <<
debugString(c) <<
"Invalid maximum comparison value:" << d->max;
106 if ((val < min) || (val > max)) {
109 QVariantMap{{QStringLiteral(
"val"), val},
110 {QStringLiteral(
"min"), min},
111 {QStringLiteral(
"max"), max}});
112 qCDebug(C_VALIDATOR).noquote()
113 <<
debugString(c) << val <<
"is not between" << min <<
"and" << max;
125 if (Q_UNLIKELY(!ok)) {
127 qCWarning(C_VALIDATOR).noquote().nospace()
128 <<
debugString(c) <<
" Can not parse input \"" << v
129 <<
"\" into a floating point number";
131 const double min = d->extractDouble(c, params, d->min, &ok);
132 if (Q_UNLIKELY(!ok)) {
134 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
135 qCWarning(C_VALIDATOR).noquote()
136 <<
debugString(c) <<
"Invalid mininum comparison value:" << d->min;
138 const double max = d->extractDouble(c, params, d->max, &ok);
139 if (Q_UNLIKELY(!ok)) {
141 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
142 qCWarning(C_VALIDATOR).noquote()
143 <<
debugString(c) <<
"Invalid maximum comparison value:" << d->max;
145 if ((val < min) || (val > max)) {
148 QVariantMap{{QStringLiteral(
"val"), val},
149 {QStringLiteral(
"min"), min},
150 {QStringLiteral(
"max"), max}});
151 qCDebug(C_VALIDATOR).noquote()
152 <<
debugString(c) << val <<
"is not between" << min <<
"and" << max;
162 const auto val =
static_cast<qlonglong
>(v.
length());
163 const qlonglong min = d->extractLongLong(c, params, d->min, &ok);
164 if (Q_UNLIKELY(!ok)) {
166 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
167 qCWarning(C_VALIDATOR).noquote()
168 <<
debugString(c) <<
"Invalid mininum comparison value:" << d->min;
170 const qlonglong max = d->extractLongLong(c, params, d->max, &ok);
171 if (Q_UNLIKELY(!ok)) {
173 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
174 qCWarning(C_VALIDATOR).noquote()
175 <<
debugString(c) <<
"Invalid maximum comparison value:" << d->max;
177 if ((val < min) || (val > max)) {
180 QVariantMap{{QStringLiteral(
"val"), val},
181 {QStringLiteral(
"min"), min},
182 {QStringLiteral(
"max"), max}});
183 qCDebug(C_VALIDATOR).noquote() <<
debugString(c) <<
"String length" << val
184 <<
"is not between" << min <<
"and" << max;
192 qCWarning(C_VALIDATOR).noquote()
193 <<
debugString(c) <<
"The comparison type" << d->type <<
"is not supported";
195 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidType));
201 const QVariant _v = d->valueToNumber(c, v, d->type);
QLocale locale() const noexcept
QString qtTrId(const char *id, int n=-1) const