Qtopia Home - Classes - Hierachy - Annotated - Functions - Qt Embedded |

# QPEDatePicker Class Reference

The QPEDatePicker class allows a date to be selected from a calendar view. More...

`#include <qtopia/datepicker.h>`

List of all member functions.

## Public Members

- QPEDatePicker ( QWidget * parent = 0, const char * name = 0 )
- virtual ~QPEDatePicker ()
- QDate selectedDate () const
- bool weekStartsMonday () const

## Public Slots

- void setDate ( int y, int m )
- void setDate ( int y, int m, int d )
- virtual void setDate ( const QDate & d )
- void setWeekStartsMonday ( bool startMonday )

## Signals

- void dateClicked ( const QDate & date )

## Protected Members

- virtual void paintDay ( const QDate & cDay, QPainter * p, const QRect & cr, const QColorGroup & cg )
- virtual void paintDayBackground ( const QDate &, QPainter * p, const QRect & cr, const QColorGroup & cg )

## Detailed Description

The QPEDatePicker class allows a date to be selected from a calendar view.

QPEDatePicker comprises a header to select month and year and a calendar view to select the date.

First availability: Qtopia 1.6

See also Qtopia Classes.

## Member Function Documentation

### QPEDatePicker::QPEDatePicker ( QWidget * parent = 0, const char * name = 0 )

Constructs a QPEDatePicker. The parent and name parameters are the standard Qt parent parameters.

### QPEDatePicker::~QPEDatePicker ()`[virtual]`

Destructs QPEDatePicker.

### void QPEDatePicker::dateClicked ( const QDate & date )`[signal]`

This signal is emitted when a date in the calendar is clicked. date contains the date that was clicked

### void QPEDatePicker::paintDay ( const QDate & cDay, QPainter * p, const QRect & cr, const QColorGroup & cg )`[virtual protected]`

Paints a single day cDay in the calendar using painter p and color group cg. The cell geometry is cr.

The default implementation draws the day of the month in the top left corner of the cell.

### void QPEDatePicker::paintDayBackground ( const QDate &, QPainter * p, const QRect & cr, const QColorGroup & cg )`[virtual protected]`

Paints the background of a single day in the calendar using painter p and color group cg. The cell geometry is cr.

The default implementation fills with the base color.

### QDate QPEDatePicker::selectedDate () const

Returns the selected date.

### void QPEDatePicker::setDate ( int y, int m )`[slot]`

Sets the selected date to year y and month m. The current day of the month is retained unless it falls outside the number of days in the selected date.

### void QPEDatePicker::setDate ( int y, int m, int d )`[slot]`

Sets the current date to year y, month m and day d.

### void QPEDatePicker::setDate ( const QDate & d )`[virtual slot]`

Sets the selected date to d.

### void QPEDatePicker::setWeekStartsMonday ( bool startMonday )`[slot]`

Display the calendar with weeks starting on Monday if startMonday is TRUE, otherwise weeks start with Sunday.

See also weekStartsMonday().

### bool QPEDatePicker::weekStartsMonday () const

Returns TRUE if the beginning of the week is Monday.

See also setWeekStartsMonday().

This file is part of the Qtopia platform, copyright © 1995-2004 Trolltech, all rights reserved.