Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QRomanCalendar Class Reference

The QRomanCalendar class is a shared base for calendars based on the ancient Roman calendar. More...

#include <qromancalendar_p.h>

+ Inheritance diagram for QRomanCalendar:
+ Collaboration diagram for QRomanCalendar:

Public Member Functions

int daysInMonth (int month, int year=QCalendar::Unspecified) const override
 Returns number of days in the month number month, in year year.
 
int minimumDaysInMonth () const override
 Returns the minimum number of days in any valid month of any valid year.
 
bool isLunar () const override
 Returns true if this calendar is a lunar calendar.
 
bool isLuniSolar () const override
 Returns true if this calendar is a lunisolar calendar.
 
bool isSolar () const override
 Returns true if this calendar is a solar calendar.
 
QString monthName (const QLocale &locale, int month, int year, QLocale::FormatType format) const override
 Returns the name of the specified month in the given year for the chosen locale, using the given format to determine how complete the name is.
 
QString standaloneMonthName (const QLocale &locale, int month, int year, QLocale::FormatType format) const override
 Returns the standalone name of the specified month in the chosen locale, using the specified format to determine how complete the name is.
 
- Public Member Functions inherited from QCalendarBackend
 QCalendarBackend ()=default
 
virtual ~QCalendarBackend ()
 Destroys the calendar backend.
 
virtual QString name () const =0
 Returns the primary name of the calendar.
 
QStringList names () const
 Returns list of names this backend was registered with.
 
QCalendar::System calendarSystem () const
 The calendar system of this calendar.
 
QCalendar::SystemId calendarId () const
 
virtual int daysInYear (int year) const
 Returns the total number of days in the year number year.
 
virtual int monthsInYear (int year) const
 Returns the total number of months in the year number year.
 
virtual bool isDateValid (int year, int month, int day) const
 Returns true if the date specified by year, month, and day is valid for this calendar; otherwise returns false.
 
virtual bool isLeapYear (int year) const =0
 Returns true if the specified year is a leap year for this calendar.
 
virtual bool isProleptic () const
 Returns true if this calendar is a proleptic calendar.
 
virtual bool hasYearZero () const
 Returns true if year number 0 is considered a valid year in this calendar.
 
virtual int maximumDaysInMonth () const
 Returns the maximum number of days in a month for any year.
 
virtual int maximumMonthsInYear () const
 Returns the maximum number of months possible in any year.
 
virtual bool dateToJulianDay (int year, int month, int day, qint64 *jd) const =0
 Computes the Julian day number corresponding to the specified year, month, and day.
 
virtual QCalendar::YearMonthDay julianDayToDate (qint64 jd) const =0
 Computes the year, month, and day in this calendar for the given Julian day number jd.
 
virtual int dayOfWeek (qint64 jd) const
 Returns the day of the week for the given Julian Day Number jd.
 
virtual qint64 matchCenturyToWeekday (const QCalendar::YearMonthDay &parts, int dow) const
 
virtual QString weekDayName (const QLocale &locale, int day, QLocale::FormatType format) const
 Returns the name of the specified day of the week in the chosen locale, using the specified format to determine how complete the name is.
 
virtual QString standaloneWeekDayName (const QLocale &locale, int day, QLocale::FormatType format) const
 Returns the standalone name of the specified day of the week in the chosen locale, using the specified format to determine how complete the name is.
 
virtual QString dateTimeToString (QStringView format, const QDateTime &datetime, QDate dateOnly, QTime timeOnly, const QLocale &locale) const
 Returns a string representing a given date, time or date-time.
 
bool isGregorian () const
 
QCalendar::SystemId registerCustomBackend (const QStringList &names)
 Register this backend as a custom backend.
 

Protected Member Functions

const QCalendarLocalelocaleMonthIndexData () const override
 
const char16_t * localeMonthData () const override
 

Additional Inherited Members

- Static Public Member Functions inherited from QCalendarBackend
static QStringList availableCalendars ()
 Returns a list of names of the available calendar systems.
 

Detailed Description

The QRomanCalendar class is a shared base for calendars based on the ancient Roman calendar.

Since
5.14

\inmodule QtCore

Calendars based on the ancient Roman calendar have several common properties: they have the same names for months, the month lengths depend in a common way on whether the year is a leap year. They differ in how they determine which years are leap years.

See also
QGregorianCalendar, QJulianCalendar, QMilankovicCalendar

Definition at line 22 of file qromancalendar_p.h.

Member Function Documentation

◆ daysInMonth()

int QRomanCalendar::daysInMonth ( int month,
int year = QCalendar::Unspecified ) const
overridevirtual

Returns number of days in the month number month, in year year.

An implementation should return 0 if the given year had no such month. If year is QCalendar::Unspecified, return the usual number of days for the month, in those years that include it.

Calendars with intercallary days may represent these as extra days of the preceding month, or as short months separate from the usual ones. In the former case, daysInMonth(month, year) should be the number of ordinary days in the month, although {isDateValid(year, month, day)} might return true for some larger values of day.

See also
daysInYear(), monthsInYear(), minimumDaysInMonth(), maximumDaysInMonth()

Implements QCalendarBackend.

Definition at line 26 of file qromancalendar.cpp.

References QCalendarBackend::isLeapYear().

+ Here is the call graph for this function:

◆ isLunar()

bool QRomanCalendar::isLunar ( ) const
overridevirtual

Returns true if this calendar is a lunar calendar.

Otherwise returns false.

A lunar calendar is a calendar based upon the monthly cycles of the Moon's phases (synodic months). This contrasts with solar calendars, whose annual cycles are based only upon the solar year.

See also
isLuniSolar(), isSolar(), isProleptic()

Implements QCalendarBackend.

Definition at line 43 of file qromancalendar.cpp.

◆ isLuniSolar()

bool QRomanCalendar::isLuniSolar ( ) const
overridevirtual

Returns true if this calendar is a lunisolar calendar.

Otherwise returns false.

A lunisolar calendar is a calendar whose date indicates both the moon phase and the time of the solar year.

See also
isLunar(), isSolar(), isProleptic()

Implements QCalendarBackend.

Definition at line 48 of file qromancalendar.cpp.

◆ isSolar()

bool QRomanCalendar::isSolar ( ) const
overridevirtual

Returns true if this calendar is a solar calendar.

Otherwise returns false.

A solar calendar is a calendar whose dates indicate the season or almost equivalently the apparent position of the sun relative to the fixed stars. The Gregorian calendar, widely accepted as standard in the world, is an example of solar calendar.

See also
isLuniSolar(), isLunar(), isProleptic()

Implements QCalendarBackend.

Definition at line 53 of file qromancalendar.cpp.

◆ localeMonthData()

const char16_t * QRomanCalendar::localeMonthData ( ) const
overrideprotectedvirtual

Implements QCalendarBackend.

Definition at line 63 of file qromancalendar.cpp.

References QtPrivate::Roman::months_data.

◆ localeMonthIndexData()

const QCalendarLocale * QRomanCalendar::localeMonthIndexData ( ) const
overrideprotectedvirtual

Implements QCalendarBackend.

Definition at line 58 of file qromancalendar.cpp.

References QtPrivate::Roman::locale_data.

◆ minimumDaysInMonth()

int QRomanCalendar::minimumDaysInMonth ( ) const
overridevirtual

Returns the minimum number of days in any valid month of any valid year.

This base implementation returns 29, as this is a common case.

See also
maximumMonthsInYear(), daysInMonth()

Reimplemented from QCalendarBackend.

Definition at line 38 of file qromancalendar.cpp.

◆ monthName()

QString QRomanCalendar::monthName ( const QLocale & locale,
int month,
int year,
QLocale::FormatType format ) const
overridevirtual

Returns the name of the specified month in the given year for the chosen locale, using the given format to determine how complete the name is.

If year is Unspecified, return the name for the month that usually has this number within a typical year. Calendars with a leap month that isn't always the last may need to take account of the year to map the month number to the particular year's month with that number.

Note
Backends for which CLDR provides data can configure the default implementation of the two month name look-up methods by arranging for localeMonthIndexData() and localeMonthData() to provide access to the CLDR data (see cldr2qlocalexml.py, qlocalexml2cpp.py and existing backends). Conversely, backends that override both month name look-up methods need not return anything meaningful from localeMonthIndexData() or localeMonthData().
See also
standaloneMonthName(), QLocale::monthName()

Reimplemented from QCalendarBackend.

Definition at line 3142 of file qlocale.cpp.

References QLocale::LongFormat, QCalendarBackend::monthName(), QSystemLocale::MonthNameLong, QSystemLocale::MonthNameNarrow, QSystemLocale::MonthNameShort, QLocale::NarrowFormat, Q_ASSERT, QLocale::ShortFormat, systemLocale(), and systemLocaleData.

+ Here is the call graph for this function:

◆ standaloneMonthName()

QString QRomanCalendar::standaloneMonthName ( const QLocale & locale,
int month,
int year,
QLocale::FormatType format ) const
overridevirtual

Returns the standalone name of the specified month in the chosen locale, using the specified format to determine how complete the name is.

If year is Unspecified, return the standalone name for the month that usually has this number within a typical year. Calendars with a leap month that isn't always the last may need to take account of the year to map the month number to the particular year's month with that number.

See also
monthName(), QLocale::standaloneMonthName()

Reimplemented from QCalendarBackend.

Definition at line 3178 of file qlocale.cpp.

References QLocale::LongFormat, QLocale::NarrowFormat, Q_ASSERT, QLocale::ShortFormat, QCalendarBackend::standaloneMonthName(), QSystemLocale::StandaloneMonthNameLong, QSystemLocale::StandaloneMonthNameNarrow, QSystemLocale::StandaloneMonthNameShort, systemLocale(), and systemLocaleData.

+ Here is the call graph for this function:

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