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
QTimePattern Class Reference

A description of a serialization format for a time. More...

#include <qttemporalpattern_p.h>

Collaboration diagram for QTimePattern:

Public Member Functions

bool isNull () const noexcept
 Returns true if this pattern has no fields, otherwise false.
bool isValid () const noexcept
void setLocale (const QLocale &loc)
const QLocale & locale () const noexcept
 Returns the current locale in use by this pattern.
Q_CORE_EXPORT QtTemporalPattern::ParseResult< QTime > parse (QStringView text, QTime defaults={}) const
 Parse and return the time represented by text.
Q_CORE_EXPORT QString serialize (const QTime &time) const
 Serialize the given time to a string representation.

Static Public Member Functions

static Q_CORE_EXPORT QTimePattern fromQtFormat (QStringView format)
 Construct a QTimePattern described by the given format string.
static QTimePattern forLocale (const QLocale &locale, QLocale::FormatType format=QLocale::LongFormat)
 Construct a QTimePattern appropriate to the given locale.

Detailed Description

A description of a serialization format for a time.

Since
6.12

Definition at line 253 of file qttemporalpattern_p.h.

Member Function Documentation

◆ forLocale()

QTimePattern QTimePattern::forLocale ( const QLocale & locale,
QLocale::FormatType format = QLocale::LongFormat )
inlinestatic

Construct a QTimePattern appropriate to the given locale.

The format can be used to select how compact or expansive the pattern is.

See also
fromQtFormat()

Definition at line 280 of file qttemporalpattern_p.h.

◆ fromQtFormat()

QTimePattern QTimePattern::fromQtFormat ( QStringView format)
static

Construct a QTimePattern described by the given format string.

If the format is empty or malformed, the returned pattern's isNull() shall be true. Otherwise, isNull() shall be false.

See also
forLocale(), isNull()

Definition at line 1090 of file qttemporalpattern.cpp.

◆ isNull()

bool QTimePattern::isNull ( ) const
inlinenoexcept

Returns true if this pattern has no fields, otherwise false.

See also
fromQtFormat()

Definition at line 266 of file qttemporalpattern_p.h.

◆ isValid()

bool QTimePattern::isValid ( ) const
inlinenoexcept

{is-valid} {time}

See also
isNull()

Definition at line 267 of file qttemporalpattern_p.h.

References QtTemporalPattern::Clear.

◆ locale()

const QLocale & QTimePattern::locale ( ) const
inlinenoexcept

Returns the current locale in use by this pattern.

See also
setLocale()

Definition at line 272 of file qttemporalpattern_p.h.

◆ parse()

QtTemporalPattern::ParseResult< QTime > QTimePattern::parse ( QStringView text,
QTime defaults = {} ) const

Parse and return the time represented by text.

parser-defaults

Definition at line 1057 of file qttemporalpattern.cpp.

◆ serialize()

QString QTimePattern::serialize ( const QTime & time) const

Serialize the given time to a string representation.

Definition at line 1075 of file qttemporalpattern.cpp.

◆ setLocale()

void QTimePattern::setLocale ( const QLocale & loc)
inline

set-locale

Definition at line 271 of file qttemporalpattern_p.h.


The documentation for this class was generated from the following files: