# class KDatePicker

###

Module | kdeui
Namespace |
Class | KDatePicker
Inherits | QFrame

A date selection widget.

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.

Author Tim Gilman, Mirko Boehm

### methods

- KDatePicker (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

  The constructor. The current date will be displayed initially.

- KDatePicker (dt, parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  dt | QDate |
  parent | QWidget | 0

  The constructor. The given date will be displayed initially.

- KDatePicker (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- KDatePicker (a0, a1)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QDate |
  a1 | QWidget | 0

- calendar ( )

  returns KCalendarSystem

  Returns the currently selected calendar system.

  Returns a KCalendarSystem object

- date ( )

  returns QDate

  Returns the selected date.

- dateChanged (date)

  returns Nothing
  SIGNAL ("dateChanged (const QDate&)")

  Argument | Type | Default
  --- | --- | ---
  date | QDate |

  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

- dateChangedSlot (date)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  date | QDate |

- dateEntered (date)

  returns Nothing
  SIGNAL ("dateEntered (const QDate&)")

  Argument | Type | Default
  --- | --- | ---
  date | QDate |

  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.

- dateSelected (date)

  returns Nothing
  SIGNAL ("dateSelected (const QDate&)")

  Argument | Type | Default
  --- | --- | ---
  date | QDate |

  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.

- dateTable ( )

  returns KDateTable

  Returns the KDateTable widget child of this KDatePicker widget.

- eventFilter (o, e)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  o | QObject |
  e | QEvent |

  to catch move keyEvents when QLineEdit has keyFocus

- fontSize ( )

  returns int

  Returns the font size of the widget elements.

- hasCloseButton ( )

  returns bool

  Returns true if a KDatePicker shows a close-button.

  See also setCloseButton

- lineEnterPressed ( )

  returns Nothing

- monthBackwardClicked ( )

  returns Nothing

- monthForwardClicked ( )

  returns Nothing

- resizeEvent (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | QResizeEvent |

  the resize event

- selectMonthClicked ( )

  returns Nothing

- selectYearClicked ( )

  returns Nothing

- setCalendar (calendar)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  calendar | KCalendarSystem | 0

  Changes the calendar system to use. Can use its own local locale if set.

  calendar - the calendar system object to use, defaults to global

  Returns true if the calendar system was successfully set, false otherwise

- setCalendar (calendarType)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  calendarType | QString |

  Changes the calendar system to use. Will always use global locale.

  calendarType - the calendar system type to use

  Returns true if the calendar system was successfully set, false otherwise

- setCloseButton (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  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

- setDate (date)

  returns bool

  Argument | Type | Default
  --- | --- | ---
  date | QDate |

  Sets the date.

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

- setEnabled (enable)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  enable | bool |

  Enables or disables the widget.

- setFontSize (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | int |

  Sets the font size of the widgets elements.

- sizeHint ( )

  returns QSize

  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.

- tableClicked ( )

  returns Nothing
  SIGNAL ("tableClicked ()")

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

- tableClickedSlot ( )

  returns Nothing

- todayButtonClicked ( )

  returns Nothing

- weekSelected (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | int |

- yearBackwardClicked ( )

  returns Nothing

- yearForwardClicked ( )

  returns Nothing