Public Types | Public Member Functions | Static Public Member Functions | Friends

QDate Class Reference

Search for all occurrences

Detailed Description

Definition at line 55 of file qdatetime.h.

#include <qdatetime.h>

List of all members.

Public Types

enum   MonthNameType { DateFormat = 0, StandaloneFormat }

Public Member Functions

  QDate ()
  QDate (int y, int m, int d)
bool  isNull () const
bool  isValid () const
int  year () const
int  month () const
int  day () const
int  dayOfWeek () const
int  dayOfYear () const
int  daysInMonth () const
int  daysInYear () const
int  weekNumber (int *yearNum=0) const
QString  toString (Qt::DateFormat f=Qt::TextDate) const
QString  toString (const QString &format) const
bool  setYMD (int y, int m, int d)
bool  setDate (int year, int month, int day)
void  getDate (int *year, int *month, int *day)
QDate  addDays (int days) const
QDate  addMonths (int months) const
QDate  addYears (int years) const
int  daysTo (const QDate &) const
bool  operator== (const QDate &other) const
bool  operator!= (const QDate &other) const
bool  operator< (const QDate &other) const
bool  operator<= (const QDate &other) const
bool  operator> (const QDate &other) const
bool  operator>= (const QDate &other) const
int  toJulianDay () const

Static Public Member Functions

static QString  shortMonthName (int month)
static QString  shortMonthName (int month, MonthNameType type)
static QString  shortDayName (int weekday)
static QString  shortDayName (int weekday, MonthNameType type)
static QString  longMonthName (int month)
static QString  longMonthName (int month, MonthNameType type)
static QString  longDayName (int weekday)
static QString  longDayName (int weekday, MonthNameType type)
static QDate  currentDate ()
static QDate  fromString (const QString &s, Qt::DateFormat f=Qt::TextDate)
static QDate  fromString (const QString &s, const QString &format)
static bool  isValid (int y, int m, int d)
static bool  isLeapYear (int year)
static uint  gregorianToJulian (int y, int m, int d)
static void  julianToGregorian (uint jd, int &y, int &m, int &d)
static QDate  fromJulianDay (int jd)

Friends

class  QDateTime
class  QDateTimePrivate
Q_CORE_EXPORT QDataStream operator<< (QDataStream &, const QDate &)
Q_CORE_EXPORT QDataStream operator>> (QDataStream &, QDate &)

Member Enumeration Documentation

Enumerator:
DateFormat 
StandaloneFormat 

Definition at line 58 of file qdatetime.h.


Constructor & Destructor Documentation

QDate ( ) [inline]

Definition at line 63 of file qdatetime.h.

{ jd = 0; }
QDate ( int  y,
int  m,
int  d 
)

Member Function Documentation

bool isNull ( ) const [inline]

Definition at line 66 of file qdatetime.h.

{ return jd == 0; }
bool isValid ( ) const
int year ( ) const
int month ( ) const
int day ( ) const
int dayOfWeek ( ) const
int dayOfYear ( ) const
int daysInMonth ( ) const
int daysInYear ( ) const
int weekNumber ( int *  yearNum = 0 ) const
static QString shortMonthName ( int  month ) [static]
static QString shortMonthName ( int  month,
MonthNameType  type 
) [static]
static QString shortDayName ( int  weekday ) [static]
static QString shortDayName ( int  weekday,
MonthNameType  type 
) [static]
static QString longMonthName ( int  month ) [static]
static QString longMonthName ( int  month,
MonthNameType  type 
) [static]
static QString longDayName ( int  weekday ) [static]
static QString longDayName ( int  weekday,
MonthNameType  type 
) [static]
QString toString ( Qt::DateFormat  f = Qt::TextDate ) const
QString toString ( const QString format ) const
bool setYMD ( int  y,
int  m,
int  d 
)
bool setDate ( int  year,
int  month,
int  day 
)
void getDate ( int *  year,
int *  month,
int *  day 
)
QDate addDays ( int  days ) const
QDate addMonths ( int  months ) const
QDate addYears ( int  years ) const
int daysTo ( const QDate ) const
bool operator== ( const QDate other ) const [inline]

Definition at line 107 of file qdatetime.h.

{ return jd == other.jd; }
bool operator!= ( const QDate other ) const [inline]

Definition at line 108 of file qdatetime.h.

{ return jd != other.jd; }
bool operator< ( const QDate other ) const [inline]

Definition at line 109 of file qdatetime.h.

{ return jd < other.jd; }
bool operator<= ( const QDate other ) const [inline]

Definition at line 110 of file qdatetime.h.

{ return jd <= other.jd; }
bool operator> ( const QDate other ) const [inline]

Definition at line 111 of file qdatetime.h.

{ return jd > other.jd; }
bool operator>= ( const QDate other ) const [inline]

Definition at line 112 of file qdatetime.h.

{ return jd >= other.jd; }
static QDate currentDate ( ) [static]
static QDate fromString ( const QString s,
Qt::DateFormat  f = Qt::TextDate 
) [static]
static QDate fromString ( const QString s,
const QString format 
) [static]
static bool isValid ( int  y,
int  m,
int  d 
) [static]
static bool isLeapYear ( int  year ) [static]
static uint gregorianToJulian ( int  y,
int  m,
int  d 
) [static]
static void julianToGregorian ( uint  jd,
int &  y,
int &  m,
int &  d 
) [static]
static QDate fromJulianDay ( int  jd ) [inline, static]

Definition at line 133 of file qdatetime.h.

{ QDate d; d.jd = jd; return d; }
int toJulianDay ( ) const [inline]

Definition at line 134 of file qdatetime.h.

{ return jd; }

Friends And Related Function Documentation

friend class QDateTime [friend]

Definition at line 139 of file qdatetime.h.

friend class QDateTimePrivate [friend]

Definition at line 140 of file qdatetime.h.

Q_CORE_EXPORT QDataStream& operator<< ( QDataStream ,
const QDate  
) [friend]
Q_CORE_EXPORT QDataStream& operator>> ( QDataStream ,
QDate  
) [friend]

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

QDate QDate QDate QDate QDate QDate QDate QDate QDate QDate
QDate QDate QDate QDate QDate QDate QDate QDate QDate QDate