Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QtParseQtTemporalFormat Namespace Reference

Classes

struct  ParsedDateTimeFormat

Functions

ParsedDateTimeFormat prefix (QStringView pattern, QtTemporalPattern::DateTimeParts form)

Variables

constexpr char timeFormats [] = "Hhmsz"
constexpr char dateFormats [] = "Mdy"

Function Documentation

◆ prefix()

Q_AUTOTEST_EXPORT ParsedDateTimeFormat QtParseQtTemporalFormat::prefix ( QStringView pattern,
QtTemporalPattern::DateTimeParts form )

Parse a prefix of pattern as a format for the data indicated by form.

Parses the longest prefix of pattern that constitutes a valid Qt temporal format string. Only the field indicator characters for data indicated in form are recognized as such; everything else (including what other forms might accept as field indicators) is treated as literal text. The only text that can be invalid is thus one containing an odd number of single quote characters; the portion up to the last of these will be parsed, in that case, and the return's endIndex will indicate the location of the unmatched single quote. Otherwise, endIndex shall equal pattern.size(). The return's fields is a list of \l {QtTemporalPattern::} {TemporalField} structures representing what was parsed, each with options matching the pre-6.12 semantics of the Qt formats for temporal data, with some tweaks to enable desired new features, notably years with (a leading sign and) more than four digits.

See also
QtTemporalPattern, QDate::fromString(), QTime::fromString(), QDateTime::fromString()

Definition at line 39 of file qtparseqttemporalformat.cpp.

Variable Documentation

◆ dateFormats

char QtParseQtTemporalFormat::dateFormats = "Mdy"
inlineconstexpr

Definition at line 16 of file qtparseqttemporalformat.cpp.

◆ timeFormats

char QtParseQtTemporalFormat::timeFormats = "Hhmsz"
inlineconstexpr

Definition at line 15 of file qtparseqttemporalformat.cpp.