class KDatePicker

# class KDatePicker | A date selection widget. More...
Definition | `#include <kdatepicker.h>`
Inherits | QFrame (qt) [public ]
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- KDatePicker (QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0)
- KDatePicker (QWidget *parent, QDate, const char *name, WFlags f)
- KDatePicker ( QWidget *parent, const char *name )
- virtual ~KDatePicker ()
- QSize sizeHint () const
- bool setDate (const QDate&)
- const QDate& getDate () const
- const QDate & date () const
- void setEnabled (bool)
- void setFontSize (int)
- int fontSize () const
- void setCloseButton ( bool enable )
- bool hasCloseButton () const

#### Signals

- void dateChanged (QDate)
- void dateSelected (QDate)
- void dateEntered (QDate)
- void tableClicked ()

#### Protected Methods

- virtual bool eventFilter (QObject *o, QEvent *e )
- virtual void resizeEvent (QResizeEvent*)
- virtual void virtual_hook ( int id, void* data )

#### Protected Slots

- void dateChangedSlot (QDate)
- void tableClickedSlot ()
- void monthForwardClicked ()
- void monthBackwardClicked ()
- void yearForwardClicked ()
- void yearBackwardClicked ()
- void selectWeekClicked ()
- void selectMonthClicked ()
- void selectYearClicked ()
- void lineEnterPressed ()

#### Protected Members

- QToolButton *yearForward
- QToolButton *yearBackward
- QToolButton *monthForward
- QToolButton *monthBackward
- QToolButton *selectMonth
- QToolButton *selectYear
- QLineEdit *line
- KDateValidator *val
- KDateTable *table
- QSize maxMonthRect

## Detailed Description

Provides a widget for calendar date input.

Different from the previous versions, it now emits two types of signals, either dateSelected() or dateEntered() (see documentation for both signals).

A line edit has been added in the newer versions to allow the user to select a date directly by entering numbers like 19990101 or 990101.

\image html kdatepicker.png "KDE Date Widget"

KDatePicker (QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0) | ### KDatePicker

The usual constructor. The given date will be displayed initially.

KDatePicker (QWidget *parent, QDate, const char *name, WFlags f) | ### KDatePicker

The usual constructor. The given date will be displayed initially.

KDatePicker ( QWidget *parent, const char *name ) | ### KDatePicker

Standard qt widget constructor. The initial date will be the current date.

~KDatePicker () | ### ~KDatePicker

[virtual]

The destructor.

QSize sizeHint () | ### sizeHint

[const]

The size hint for date pickers. The size hint recommends the minimum size of the widget so that all elements may be placed without clipping. This sometimes looks ugly, so when using the size hint, try adding 28 to each of the reported numbers of pixels.

bool setDate (const QDate&) | ### setDate

Sets the date.

Returns: `false` and does not change anything if the date given is invalid.

const QDate& getDate () | ### getDate

[const]

Returns the selected date.

const QDate & date () | ### date

[const]

Returns: the selected date.

void setEnabled (bool) | ### setEnabled

Enables or disables the widget.

void setFontSize (int) | ### setFontSize

Sets the font size of the widgets elements.

int fontSize () | ### fontSize

[const]

Returns the font size of the widget elements.

void setCloseButton ( bool enable ) | ### setCloseButton

By calling this method with `enable` = true, KDatePicker will show a little close-button in the upper button-row. Clicking the close-button will cause the KDatePicker's topLevelWidget()'s close() method being called. This is mostly useful for toplevel datepickers without a window manager decoration.

See also: hasCloseButton

bool hasCloseButton () | ### hasCloseButton

[const]

Returns: true if a KDatePicker shows a close-button.

See also: setCloseButton

bool eventFilter (QObject *o, QEvent *e ) | ### eventFilter

[protected virtual]

void resizeEvent (QResizeEvent*) | ### resizeEvent

[protected virtual]

Reimplemented from QFrame.

QToolButton * yearForward | ### yearForward

[protected]

QToolButton * yearBackward | ### yearBackward

[protected]

QToolButton * monthForward | ### monthForward

[protected]

QToolButton * monthBackward | ### monthBackward

[protected]

QToolButton * selectMonth | ### selectMonth

[protected]

QToolButton * selectYear | ### selectYear

[protected]

QLineEdit * line | ### line

[protected]

KDateValidator * val | ### val

[protected]

KDateTable * table | ### table

[protected]

QSize maxMonthRect | ### maxMonthRect

[protected]

void dateChangedSlot (QDate) | ### dateChangedSlot

[protected slots slot]

void tableClickedSlot () | ### tableClickedSlot

[protected slots slot]

void monthForwardClicked () | ### monthForwardClicked

[protected slots slot]

void monthBackwardClicked () | ### monthBackwardClicked

[protected slots slot]

void yearForwardClicked () | ### yearForwardClicked

[protected slots slot]

void yearBackwardClicked () | ### yearBackwardClicked

[protected slots slot]

void selectWeekClicked () | ### selectWeekClicked

[protected slots slot]

void selectMonthClicked () | ### selectMonthClicked

[protected slots slot]

void selectYearClicked () | ### selectYearClicked

[protected slots slot]

void lineEnterPressed () | ### lineEnterPressed

[protected slots slot]

void dateChanged (QDate) | ### dateChanged

[signal]

This signal is emitted each time the selected date is changed. Usually, this does not mean that the date has been entered, since the date also changes, for example, when another month is selected.

See also: dateSelected

void dateSelected (QDate) | ### dateSelected

[signal]

This signal is emitted each time a day has been selected by clicking on the table (hitting a day in the current month). It has the same meaning as dateSelected() in older versions of KDatePicker.

void dateEntered (QDate) | ### dateEntered

[signal]

This signal is emitted when enter is pressed and a VALID date has been entered before into the line edit. Connect to both dateEntered() and dateSelected() to receive all events where the user really enters a date.

void tableClicked () | ### tableClicked

[signal]

This signal is emitted when the day has been selected by clicking on it in the table.

void virtual_hook ( int id, void* data ) | ### virtual_hook

[protected virtual]

- Version: $Id: kdatepicker.h,v 1.30 2002/09/28 15:16:22 tjansen Exp $
- Author: Tim Gilman, Mirko Boehm
- Generated: root on macppc.ports.openbsd.org on Sat Sep 6 10:36:37 2003, using kdoc 2.0a54.