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

The QHijriCalendar class supports Islamic (Hijri) calendar implementations. More...

#include <qhijricalendar_p.h>

+ Inheritance diagram for QHijriCalendar:
+ Collaboration diagram for QHijriCalendar:

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 maximumDaysInMonth () const override
 Returns the maximum number of days in a month for any year.
 
int daysInYear (int year) const override
 Returns the total number of days in the year number 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.
 
- 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 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 minimumDaysInMonth () const
 Returns the minimum number of days in any valid month of any valid 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 monthName (const QLocale &locale, int month, int year, QLocale::FormatType format) const
 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.
 
virtual QString standaloneMonthName (const QLocale &locale, int month, int year, QLocale::FormatType format) const
 Returns the standalone name of the specified month in the chosen locale, using the specified format to determine how complete the name is.
 
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 QHijriCalendar class supports Islamic (Hijri) calendar implementations.

Since
5.14

\inmodule QtCore

The Islamic, Muslim, or Hijri calendar is a lunar calendar consisting of 12 months in a year of 354 or 355 days. It is used (often alongside the Gregorian calendar) to date events in many Muslim countries. It is also used by Muslims to determine the proper days of Islamic holidays and rituals, such as the annual period of fasting and the proper time for the pilgrimage to Mecca.

Source: \l {https://en.wikipedia.org/wiki/Islamic_calendar}{Wikipedia page on Hijri Calendar}

This base class provides the common details shared by all variants on the Islamic calendar. Each year comprises 12 months of 29 or 30 days each; most years have as many of 29 as of 30, but leap years extend one 29-day month to 30 days. In tabular versions of the calendar (where mathematical rules are used to determine the details), odd-numbered months have 30 days, as does the last (twelfth) month of a leap year; all other months have 29 days. Other versions are based on actual astronomical observations of the moon's phase at sunset, which vary from place to place.

See also
QIslamicCivilCalendar, QCalendar

Definition at line 26 of file qhijricalendar_p.h.

Member Function Documentation

◆ daysInMonth()

int QHijriCalendar::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 59 of file qhijricalendar.cpp.

References QCalendarBackend::isLeapYear().

+ Here is the call graph for this function:

◆ daysInYear()

int QHijriCalendar::daysInYear ( int year) const
overridevirtual

Returns the total number of days in the year number year.

Returns zero if there is no such year in this calendar.

This base implementation returns 366 for leap years and 365 for ordinary years.

See also
monthsInYear(), daysInMonth(), isLeapYear()

Reimplemented from QCalendarBackend.

Definition at line 75 of file qhijricalendar.cpp.

References QCalendarBackend::isLeapYear(), and QCalendarBackend::monthsInYear().

+ Here is the call graph for this function:

◆ isLunar()

bool QHijriCalendar::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 44 of file qhijricalendar.cpp.

◆ isLuniSolar()

bool QHijriCalendar::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 49 of file qhijricalendar.cpp.

◆ isSolar()

bool QHijriCalendar::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 54 of file qhijricalendar.cpp.

◆ localeMonthData()

const char16_t * QHijriCalendar::localeMonthData ( ) const
overrideprotectedvirtual

Implements QCalendarBackend.

Definition at line 85 of file qhijricalendar.cpp.

References QtPrivate::Hijri::months_data.

◆ localeMonthIndexData()

const QCalendarLocale * QHijriCalendar::localeMonthIndexData ( ) const
overrideprotectedvirtual

Implements QCalendarBackend.

Definition at line 80 of file qhijricalendar.cpp.

References QtPrivate::Hijri::locale_data.

◆ maximumDaysInMonth()

int QHijriCalendar::maximumDaysInMonth ( ) const
overridevirtual

Returns the maximum number of days in a month for any year.

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

For calendars with intercallary days, although daysInMonth() doesn't include the intercallary days in its count for an individual month, maximumDaysInMonth() should include intercallary days, so that it is the maximum value of day for which {isDateValid(year, month, day)} can be true.

See also
maximumMonthsInYear(), daysInMonth()

Reimplemented from QCalendarBackend.

Definition at line 70 of file qhijricalendar.cpp.


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