KDatePicker Class Reference
from PyKDE4.kdeui 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"
Method Documentation
__init__ | ( | self, | ||
QWidget | parent=0 | |||
) |
The constructor. The current date will be displayed initially.
The constructor. The given date will be displayed initially.
KCalendarSystem calendar | ( | self ) |
Returns the currently selected calendar system.
- Returns:
- a KCalendarSystem object
QDate date | ( | self ) |
- Returns:
- the selected date.
dateChanged | ( | self, | ||
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)
dateChangedSlot | ( | self, | ||
QDate | date | |||
) |
dateEntered | ( | self, | ||
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 | ( | self, | ||
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)
KDateTable dateTable | ( | self ) |
- Returns:
- the KDateTable widget child of this KDatePicker widget.
int fontSize | ( | self ) |
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 | |||
) |
the resize event
selectMonthClicked | ( | self ) |
selectYearClicked | ( | self ) |
bool setCalendar | ( | self, | ||
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
bool setCalendar | ( | self, | ||
QString | calendarType | |||
) |
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
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.
setEnabled | ( | self, | ||
bool | enable | |||
) |
Enables or disables the widget.
setFontSize | ( | self, | ||
int | a0 | |||
) |
Sets the font size of the widgets elements.
QSize sizeHint | ( | self ) |
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 | ( | self ) |
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)
tableClickedSlot | ( | self ) |
todayButtonClicked | ( | self ) |
weekSelected | ( | self, | ||
int | a0 | |||
) |
yearBackwardClicked | ( | self ) |
yearForwardClicked | ( | self ) |