1 #include "DlgValidatorNumber.h"
3 #include <QDoubleValidator>
10 m_coordScale (coordScale),
13 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgValidatorNumber::DlgValidatorNumber";
20 QDoubleValidator validator;
21 validator.setLocale (m_locale);
22 QValidator::State state = validator.validate (input,
24 if (state == QValidator::Acceptable) {
26 if (m_coordScale == COORD_SCALE_LOG) {
27 if (input.toDouble () < 0.0) {
30 state = QValidator::Invalid;
32 }
if (input.toDouble () == 0.0) {
35 state = QValidator::Intermediate;
Abstract validator for all numeric formats.
virtual QValidator::State validate(QString &input, int &pos) const
Apply the standard validation with 0 as the exclusive minimum. Call setCoordScale just before calling...
DlgValidatorNumber(CoordScale coordScale, const QLocale &locale, QObject *parent=0)
Single constructor.