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.cpp
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qglobal.h"
5#include "qhijricalendar_p.h"
7
9
45{
46 return true;
47}
48
50{
51 return false;
52}
53
55{
56 return false;
57}
58
59int QHijriCalendar::daysInMonth(int month, int year) const
60{
61 if (year == 0 || month < 1 || month > 12)
62 return 0;
63
64 if (month == 12 && isLeapYear(year))
65 return 30;
66
67 return month % 2 == 0 ? 29 : 30;
68}
69
71{
72 return 30;
73}
74
75int QHijriCalendar::daysInYear(int year) const
76{
77 return monthsInYear(year) ? isLeapYear(year) ? 355 : 354 : 0;
78}
79
84
85const char16_t *QHijriCalendar::localeMonthData() const
86{
88}
89
virtual bool isLeapYear(int year) const =0
Returns true if the specified year is a leap year for this calendar.
virtual int monthsInYear(int year) const
Returns the total number of months in the year number year.
int daysInYear(int year) const override
Returns the total number of days in the year number year.
const QCalendarLocale * localeMonthIndexData() const override
bool isLunar() const override
Returns true if this calendar is a lunar calendar.
bool isSolar() const override
Returns true if this calendar is a solar calendar.
int maximumDaysInMonth() const override
Returns the maximum number of days in a month for any year.
bool isLuniSolar() const override
Returns true if this calendar is a lunisolar calendar.
const char16_t * localeMonthData() const override
int daysInMonth(int month, int year=QCalendar::Unspecified) const override
Returns number of days in the month number month, in year year.
Combined button and popup list for selecting options.
static constexpr char16_t months_data[]
static constexpr QCalendarLocale locale_data[]