KDEUI
KDatePicker Class Reference
A date selection widget. More...
#include <kdatepicker.h>

Signals | |
void | dateChanged (const QDate &date) |
void | dateEntered (const QDate &date) |
void | dateSelected (const QDate &date) |
void | tableClicked () |
Public Member Functions | |
const KCalendarSystem * | calendar () const |
const QDate & | date () const |
KDateTable * | dateTable () const |
int | fontSize () const |
bool | hasCloseButton () const |
KDatePicker (const QDate &dt, QWidget *parent=0) | |
KDatePicker (QWidget *parent=0) | |
bool | setCalendar (const QString &calendarType) |
bool | setCalendar (KCalendarSystem *calendar=0) |
void | setCloseButton (bool enable) |
bool | setDate (const QDate &date) |
void | setEnabled (bool enable) |
void | setFontSize (int) |
QSize | sizeHint () const |
virtual | ~KDatePicker () |
Protected Slots | |
void | dateChangedSlot (const QDate &date) |
void | lineEnterPressed () |
void | monthBackwardClicked () |
void | monthForwardClicked () |
void | selectMonthClicked () |
void | selectYearClicked () |
void | tableClickedSlot () |
void | todayButtonClicked () |
void | uncheckYearSelector () |
void | weekSelected (int) |
void | yearBackwardClicked () |
void | yearForwardClicked () |
Protected Member Functions | |
virtual bool | eventFilter (QObject *o, QEvent *e) |
virtual void | resizeEvent (QResizeEvent *) |
Properties | |
bool | closeButton |
QDate | date |
int | fontSize |
Detailed Description
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.

KDE Date Widget
Definition at line 53 of file kdatepicker.h.
Constructor & Destructor Documentation
KDatePicker::KDatePicker | ( | QWidget * | parent = 0 |
) | [explicit] |
The constructor.
The current date will be displayed initially.
Definition at line 252 of file kdatepicker.cpp.
KDatePicker::KDatePicker | ( | const QDate & | dt, | |
QWidget * | parent = 0 | |||
) | [explicit] |
The constructor.
The given date will be displayed initially.
Definition at line 257 of file kdatepicker.cpp.
KDatePicker::~KDatePicker | ( | ) | [virtual] |
The destructor.
Definition at line 370 of file kdatepicker.cpp.
Member Function Documentation
const KCalendarSystem * KDatePicker::calendar | ( | ) | const |
Returns the currently selected calendar system.
- Returns:
- a KCalendarSystem object
Definition at line 438 of file kdatepicker.cpp.
const QDate& KDatePicker::date | ( | ) | const |
- Returns:
- the selected date.
void KDatePicker::dateChanged | ( | const QDate & | date | ) | [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 KDatePicker::dateChangedSlot | ( | const QDate & | date | ) | [protected, slot] |
Definition at line 397 of file kdatepicker.cpp.
void KDatePicker::dateEntered | ( | const QDate & | date | ) | [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 KDatePicker::dateSelected | ( | const QDate & | date | ) | [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.
KDateTable * KDatePicker::dateTable | ( | ) | const |
- Returns:
- the KDateTable widget child of this KDatePicker widget.
Definition at line 601 of file kdatepicker.cpp.
to catch move keyEvents when QLineEdit has keyFocus
Definition at line 375 of file kdatepicker.cpp.
int KDatePicker::fontSize | ( | ) | const |
Returns the font size of the widget elements.
bool KDatePicker::hasCloseButton | ( | ) | const |
- Returns:
- true if a KDatePicker shows a close-button.
- See also:
- setCloseButton
Definition at line 715 of file kdatepicker.cpp.
void KDatePicker::lineEnterPressed | ( | ) | [protected, slot] |
Definition at line 606 of file kdatepicker.cpp.
void KDatePicker::monthBackwardClicked | ( | ) | [protected, slot] |
Definition at line 461 of file kdatepicker.cpp.
void KDatePicker::monthForwardClicked | ( | ) | [protected, slot] |
Definition at line 453 of file kdatepicker.cpp.
void KDatePicker::resizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
the resize event
Definition at line 392 of file kdatepicker.cpp.
void KDatePicker::selectMonthClicked | ( | ) | [protected, slot] |
Definition at line 495 of file kdatepicker.cpp.
void KDatePicker::selectYearClicked | ( | ) | [protected, slot] |
Definition at line 537 of file kdatepicker.cpp.
Changes the calendar system to use.
Will always use global locale.
- Parameters:
-
calendarType the calendar system type to use
- Returns:
true
if the calendar system was successfully set,false
otherwise
Definition at line 448 of file kdatepicker.cpp.
bool KDatePicker::setCalendar | ( | KCalendarSystem * | calendar = 0 |
) |
Changes the calendar system to use.
Can use its own local locale if set.
- Parameters:
-
calendar the calendar system object to use, defaults to global
- Returns:
true
if the calendar system was successfully set,false
otherwise
Definition at line 443 of file kdatepicker.cpp.
void KDatePicker::setCloseButton | ( | bool | enable | ) |
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
Definition at line 692 of file kdatepicker.cpp.
bool KDatePicker::setDate | ( | const QDate & | date | ) |
Sets the date.
- Returns:
false
and does not change anything if the date given is invalid.
Definition at line 431 of file kdatepicker.cpp.
void KDatePicker::setEnabled | ( | bool | enable | ) |
Enables or disables the widget.
Definition at line 585 of file kdatepicker.cpp.
void KDatePicker::setFontSize | ( | int | s | ) |
Sets the font size of the widgets elements.
Definition at line 630 of file kdatepicker.cpp.
QSize KDatePicker::sizeHint | ( | void | ) | 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.
Definition at line 625 of file kdatepicker.cpp.
void KDatePicker::tableClicked | ( | ) | [signal] |
This signal is emitted when the day has been selected by clicking on it in the table.
void KDatePicker::tableClickedSlot | ( | ) | [protected, slot] |
Definition at line 420 of file kdatepicker.cpp.
void KDatePicker::todayButtonClicked | ( | ) | [protected, slot] |
Definition at line 619 of file kdatepicker.cpp.
void KDatePicker::uncheckYearSelector | ( | ) | [protected, slot] |
Definition at line 577 of file kdatepicker.cpp.
void KDatePicker::weekSelected | ( | int | index | ) | [protected, slot] |
Definition at line 485 of file kdatepicker.cpp.
void KDatePicker::yearBackwardClicked | ( | ) | [protected, slot] |
Definition at line 477 of file kdatepicker.cpp.
void KDatePicker::yearForwardClicked | ( | ) | [protected, slot] |
Definition at line 469 of file kdatepicker.cpp.
Property Documentation
bool KDatePicker::closeButton [read, write] |
Definition at line 58 of file kdatepicker.h.
const QDate & KDatePicker::date [read, write] |
Definition at line 56 of file kdatepicker.h.
int KDatePicker::fontSize [read, write] |
Definition at line 59 of file kdatepicker.h.
The documentation for this class was generated from the following files: