KDatePicker Class Reference
from PyKDE5.kwidgetsaddons import *
Inherits: QFrame → QWidget → QObject
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"
- Author:
- Tim Gilman, Mirko Boehm
Signals |
| dateChanged (QDate date) |
| dateEntered (QDate date) |
| dateSelected (QDate date) |
| tableClicked () |
Methods |
| __init__ (self, QWidget parent=0) |
| __init__ (self, QDate dt, QWidget parent=0) |
| changeEvent (self, QEvent event) |
QDate | date (self) |
| dateChangedSlot (self, QDate date) |
bool | eventFilter (self, QObject o, QEvent e) |
int | fontSize (self) |
bool | hasCloseButton (self) |
| lineEnterPressed (self) |
| monthBackwardClicked (self) |
| monthForwardClicked (self) |
| resizeEvent (self, QResizeEvent a0) |
| selectMonthClicked (self) |
| selectYearClicked (self) |
| setCloseButton (self, bool enable) |
bool | setDate (self, QDate date) |
| setFontSize (self, int a0) |
QSize | sizeHint (self) |
| tableClickedSlot (self) |
| todayButtonClicked (self) |
| uncheckYearSelector (self) |
| weekSelected (self, int a0) |
| yearBackwardClicked (self) |
| yearForwardClicked (self) |
Signal Documentation
dateChanged |
( |
QDate |
date |
|
) |
|
|
|
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
- Signal syntax:
QObject.connect(source, SIGNAL("dateChanged(const QDate&)"), target_slot)
dateEntered |
( |
QDate |
date |
|
) |
|
|
|
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.
- Signal syntax:
QObject.connect(source, SIGNAL("dateEntered(const QDate&)"), target_slot)
dateSelected |
( |
QDate |
date |
|
) |
|
|
|
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.
- Signal syntax:
QObject.connect(source, SIGNAL("dateSelected(const QDate&)"), target_slot)
This signal is emitted when the day has been selected by
clicking on it in the table.
- Signal syntax:
QObject.connect(source, SIGNAL("tableClicked()"), target_slot)
Method Documentation
__init__ |
( |
self, |
|
|
|
QWidget |
parent=0 |
|
) |
|
|
|
The constructor. The current date will be displayed initially.
__init__ |
( |
self, |
|
|
|
QDate |
dt, |
|
|
QWidget |
parent=0 |
|
) |
|
|
|
The constructor. The given date will be displayed initially.
changeEvent |
( |
self, |
|
|
|
QEvent |
event |
|
) |
|
|
|
- Returns:
- the selected date.
dateChangedSlot |
( |
self, |
|
|
|
QDate |
date |
|
) |
|
|
|
bool eventFilter |
( |
self, |
|
|
|
QObject |
o, |
|
|
QEvent |
e |
|
) |
|
|
|
Returns the font size of the widget elements.
bool hasCloseButton |
( |
|
self ) |
|
- Returns:
- true if a KDatePicker shows a close-button.
- See also:
- setCloseButton
lineEnterPressed |
( |
|
self ) |
|
monthBackwardClicked |
( |
|
self ) |
|
monthForwardClicked |
( |
|
self ) |
|
resizeEvent |
( |
self, |
|
|
|
QResizeEvent |
a0 |
|
) |
|
|
|
selectMonthClicked |
( |
|
self ) |
|
selectYearClicked |
( |
|
self ) |
|
setCloseButton |
( |
self, |
|
|
|
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
bool setDate |
( |
self, |
|
|
|
QDate |
date |
|
) |
|
|
|
Sets the date.
- Returns:
- false and does not change anything if the date given is invalid.
setFontSize |
( |
self, |
|
|
|
int |
a0 |
|
) |
|
|
|
Sets the font size of the widgets elements.
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.
tableClickedSlot |
( |
|
self ) |
|
todayButtonClicked |
( |
|
self ) |
|
uncheckYearSelector |
( |
|
self ) |
|
weekSelected |
( |
self, |
|
|
|
int |
a0 |
|
) |
|
|
|
yearBackwardClicked |
( |
|
self ) |
|
yearForwardClicked |
( |
|
self ) |
|