Engauge Digitizer  2
DlgValidatorDateTime.cpp
1 /******************************************************************************************************
2  * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #include "DlgValidatorDateTime.h"
8 #include "FormatDateTime.h"
9 #include "Logger.h"
10 
12  CoordUnitsDate coordUnitsDate,
13  CoordUnitsTime coordUnitsTime,
14  QObject *parent) :
15  DlgValidatorAbstract(parent),
16  m_coordScale (coordScale),
17  m_coordUnitsDate (coordUnitsDate),
18  m_coordUnitsTime (coordUnitsTime)
19 {
20  LOG4CPP_INFO_S ((*mainCat)) << "DlgValidatorDateTime::DlgValidatorDateTime";
21 }
22 
23 QValidator::State DlgValidatorDateTime::validate (QString &input,
24  int & /* pos */) const
25 {
26  FormatDateTime formatDateTime;
27  double value;
28  return formatDateTime.parseInput (m_coordUnitsDate,
29  m_coordUnitsTime,
30  input,
31  value);
32 }
DlgValidatorDateTime(CoordScale coordScale, CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, QObject *parent=0)
Single constructor.
Abstract validator for all numeric formats.
QValidator::State parseInput(CoordUnitsDate coordUnitsDate, CoordUnitsTime coordUnitsTime, const QString &stringUntrimmed, double &value) const
Parse the input string into a time value.
virtual QValidator::State validate(QString &input, int &pos) const
Validate according to the numeric format specific to the leaf class.
Input parsing and output formatting for date/time values.