4#ifndef QDATETIMEPARSER_P_H
5#define QDATETIMEPARSER_P_H
18#include <QtCore/private/qglobal_p.h>
19#include "qplatformdefs.h"
20#include "QtCore/qatomic.h"
21#include "QtCore/qcalendar.h"
22#include "QtCore/qcoreapplication.h"
23#include "QtCore/qdatetime.h"
24#include "QtCore/qlist.h"
25#include "QtCore/qlocale.h"
26#include "QtCore/qstringlist.h"
27#ifndef QT_BOOTSTRAPPED
28# include "QtCore/qvariant.h"
33#define QDATETIMEEDIT_TIME_MIN QTime(0, 0)
34#define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999)
35#define QDATETIMEEDIT_DATE_MIN QDate(100, 1, 1)
36#define QDATETIMEEDIT_COMPAT_DATE_MIN QDate(1752, 9, 14)
37#define QDATETIMEEDIT_DATE_MAX QDate(9999, 12, 31)
38#define QDATETIMEEDIT_DATE_INITIAL QDate(2000, 1, 1)
53 first.type = FirstSection;
56 first.zeroesAdded = 0;
57 last.type = LastSection;
61 none.type = NoSection;
70 AmPmSection = 0x00001,
71 MSecSection = 0x00002,
72 SecondSection = 0x00004,
73 MinuteSection = 0x00008,
74 Hour12Section = 0x00010,
75 Hour24Section = 0x00020,
76 TimeZoneSection = 0x00040,
77 HourSectionMask = (Hour12Section | Hour24Section),
78 TimeSectionMask = (MSecSection | SecondSection | MinuteSection |
79 HourSectionMask | AmPmSection | TimeZoneSection),
82 MonthSection = 0x00200,
83 YearSection = 0x00400,
84 YearSection2Digits = 0x00800,
85 YearSectionMask = YearSection | YearSection2Digits,
86 DayOfWeekSectionShort = 0x01000,
87 DayOfWeekSectionLong = 0x02000,
88 DayOfWeekSectionMask = DayOfWeekSectionShort | DayOfWeekSectionLong,
89 DaySectionMask = DaySection | DayOfWeekSectionMask,
90 DateSectionMask = DaySectionMask | MonthSection | YearSectionMask,
93 FirstSection = 0x20000 | Internal,
94 LastSection = 0x40000 | Internal,
95 CalendarPopupSection = 0x80000 | Internal,
98 FirstSectionIndex = -2,
99 LastSectionIndex = -3,
100 CalendarPopupIndex = -4
113 int maxChange()
const;
138 const QDateTime &defaultValue,
bool fixup)
const;
152 FieldInfo fieldInfo(
int index)
const;
159 int sectionMaxSize(Section
s,
int count)
const;
161 StateNode scanString(
const QDateTime &defaultValue,
bool fixup)
const;
162 struct ParsedSection {
168 int val = 0,
int read = 0,
int zs = 0)
174 int year,
QString *monthName =
nullptr,
int *used =
nullptr)
const;
176 QString *dayName =
nullptr,
int *used =
nullptr)
const;
180 int maxVal,
int minVal,
int mode)
const;
190 AmPmFinder findAmPm(
QString &
str,
int index,
int *used =
nullptr)
const;
206 QString getAmPmText(AmPm ap, Case cs)
const;
209 friend class QDTPUnitTestParser;
212 int sectionSize(
int index)
const;
213 int sectionMaxSize(
int index)
const;
214 int sectionPos(
int index)
const;
219 QString sectionText(
int sectionIndex)
const;
224 int absoluteMin(
int index)
const;
229 return skipToNextSection(section, current,
QStringView(sectionText));
238 mutable int currentSectionIndex = int(NoSectionIndex);
254 mutable int cachedDay = -1;
The QCalendar class describes calendar systems.
QDateTimeParser(QMetaType::Type t, Context ctx, QCalendar cal=QCalendar())
virtual QLocale locale() const
virtual QString displayText() const
virtual int cursorPosition() const
QList< SectionNode > sectionNodes
void setDefaultLocale(const QLocale &loc)
QMetaType::Type parserType
bool skipToNextSection(int section, const QDateTime ¤t, const QString §ionText) const
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
static constexpr int DefaultTwoDigitBaseYear
static QLocale system()
Returns a QLocale object initialized to the system locale.
\macro QT_RESTRICTED_CAST_FROM_ASCII
\inmodule QtCore \reentrant
cache insert(employee->id(), employee)
Combined button and popup list for selecting options.
Q_CORE_EXPORT bool operator==(QDateTimeParser::SectionNode s1, QDateTimeParser::SectionNode s2)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat s1
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLenum GLenum GLenum input
static bool fromString(const QMetaObject *mo, QString s, Allocate &&allocate)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_REQUIRE_CONFIG(feature)
#define Q_DECLARE_TYPEINFO(TYPE, FLAGS)
ReturnedValue read(const char *data)
StateNode(const QDateTime &val, State ok=Acceptable, int pad=0, bool bad=false)