[Development] Calendar Types

qtdev at madagon.com qtdev at madagon.com
Thu Oct 17 19:30:06 CEST 2013


finally, I'm going to update date time classes to support world calendar 
types while keeping the binary compatibility.

here's an overview of the new changes to be done at this level. Please 
review and let me know if something wrong.

#JohnLayt I'd like to specially hear from you.

• The new Qt::CalendarType enumeration which contains Gregorian, Hebrew, 
Islamic, Persian and Hindu

• These QDate methods will get a new parameter of type Qt::CalendarType 
(Gregorian by default):
QDate(int y, int m, int d)
int day() const
int dayOfWeek() const
int dayOfYear() const
int daysInMonth() const
int daysInYear() const
void getDate(int * year, int * month, int * day)
bool setDate(int year, int month, int day)
QString toString(const QString & format) const
QString toString(Qt::DateFormat format = Qt::TextDate) const
int weekNumber(int * yearNumber = 0) const
int year() const
QDate fromString(const QString & string, Qt::DateFormat format = 
Qt::TextDate)
QDate	fromString(const QString & string, const QString & format)
bool isLeapYear(int year)
QString longDayName(int weekday, MonthNameType type = DateFormat)
QString longMonthName(int month, MonthNameType type = DateFormat)
QString shortDayName(int weekday, MonthNameType type = DateFormat)
QString shortMonthName(int month, MonthNameType type = DateFormat)

• These QDateTime methods will get a new parameter of type 
Qt::CalendarType (Gregorian by default):
QString toString(const QString & format) const
QString toString(Qt::DateFormat format = Qt::TextDate) const
QDateTime fromString(const QString & string, Qt::DateFormat format = 
Qt::TextDate)
QDateTime fromString(const QString & string, const QString & format)




More information about the Development mailing list