44 if (Q_UNLIKELY(!ok)) {
46 qCWarning(C_VALIDATOR).noquote().nospace()
48 <<
"\" into an integer number";
51 ValidatorBetweenPrivate::extractLongLong(c, params, d->min, &ok);
52 if (Q_UNLIKELY(!ok)) {
54 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
55 qCWarning(C_VALIDATOR).noquote()
56 <<
"Invalid mininum comparison value:" << d->min;
59 ValidatorBetweenPrivate::extractLongLong(c, params, d->max, &ok);
60 if (Q_UNLIKELY(!ok)) {
62 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
63 qCWarning(C_VALIDATOR).noquote()
64 <<
"Invalid maximum comparison value:" << d->max;
66 if ((val < min) || (val > max)) {
69 QVariantMap{{QStringLiteral(
"val"), val},
70 {QStringLiteral(
"min"), min},
71 {QStringLiteral(
"max"), max}});
72 qCDebug(C_VALIDATOR).noquote()
73 <<
debugString(c) << val <<
"is not between" << min <<
"and" << max;
88 if (Q_UNLIKELY(!ok)) {
90 qCWarning(C_VALIDATOR).noquote().nospace()
92 <<
"\" into an unsigned integer number";
94 const qulonglong min =
95 ValidatorBetweenPrivate::extractULongLong(c, params, d->min, &ok);
96 if (Q_UNLIKELY(!ok)) {
98 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
99 qCWarning(C_VALIDATOR).noquote()
100 <<
debugString(c) <<
"Invalid mininum comparison value:" << d->min;
102 const qulonglong max =
103 ValidatorBetweenPrivate::extractULongLong(c, params, d->max, &ok);
104 if (Q_UNLIKELY(!ok)) {
106 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
107 qCWarning(C_VALIDATOR).noquote()
108 <<
debugString(c) <<
"Invalid maximum comparison value:" << d->max;
110 if ((val < min) || (val > max)) {
113 QVariantMap{{QStringLiteral(
"val"), val},
114 {QStringLiteral(
"min"), min},
115 {QStringLiteral(
"max"), max}});
116 qCDebug(C_VALIDATOR).noquote()
117 <<
debugString(c) << val <<
"is not between" << min <<
"and" << max;
129 if (Q_UNLIKELY(!ok)) {
131 qCWarning(C_VALIDATOR).noquote().nospace()
132 <<
debugString(c) <<
" Can not parse input \"" << v
133 <<
"\" into a floating point number";
135 const double min = ValidatorBetweenPrivate::extractDouble(c, params, d->min, &ok);
136 if (Q_UNLIKELY(!ok)) {
138 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
139 qCWarning(C_VALIDATOR).noquote()
140 <<
debugString(c) <<
"Invalid mininum comparison value:" << d->min;
143 ValidatorBetweenPrivate::extractDouble(c, params, d->max, &ok);
144 if (Q_UNLIKELY(!ok)) {
146 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
147 qCWarning(C_VALIDATOR).noquote()
148 <<
debugString(c) <<
"Invalid maximum comparison value:" << d->max;
150 if ((val < min) || (val > max)) {
153 QVariantMap{{QStringLiteral(
"val"), val},
154 {QStringLiteral(
"min"), min},
155 {QStringLiteral(
"max"), max}});
156 qCDebug(C_VALIDATOR).noquote()
157 <<
debugString(c) << val <<
"is not between" << min <<
"and" << max;
167 const auto val =
static_cast<qlonglong
>(v.
length());
168 const qlonglong min = ValidatorBetweenPrivate::extractLongLong(c, params, d->min, &ok);
169 if (Q_UNLIKELY(!ok)) {
171 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMin));
172 qCWarning(C_VALIDATOR).noquote()
173 <<
debugString(c) <<
"Invalid mininum comparison value:" << d->min;
175 const qlonglong max =
176 ValidatorBetweenPrivate::extractLongLong(c, params, d->max, &ok);
177 if (Q_UNLIKELY(!ok)) {
179 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidMax));
180 qCWarning(C_VALIDATOR).noquote()
181 <<
debugString(c) <<
"Invalid maximum comparison value:" << d->max;
183 if ((val < min) || (val > max)) {
186 QVariantMap{{QStringLiteral(
"val"), val},
187 {QStringLiteral(
"min"), min},
188 {QStringLiteral(
"max"), max}});
189 qCDebug(C_VALIDATOR).noquote() <<
debugString(c) <<
"String length" << val
190 <<
"is not between" << min <<
"and" << max;
198 qCWarning(C_VALIDATOR).noquote()
199 <<
debugString(c) <<
"The comparison type" << d->type <<
"is not supported";
201 c,
static_cast<int>(ValidatorRulePrivate::ErrorType::InvalidType));
207 const QVariant _v = ValidatorBetweenPrivate::valueToNumber(c, v, d->type);
QLocale locale() const noexcept
QString qtTrId(const char *id, int n=-1) const