KDatePicker Class Reference
Provides a widget for calendar date input. A date selection widget. More...
#include <mkdatepicker.h>
Inheritance diagram for KDatePicker:

Signals | |
void | dateChanged (QDate) |
This signal is emitted each time the selected date is changed. | |
void | dateSelected (QDate) |
This signal is emitted each time a day has been selected by clicking on the table (hitting a day in the current month). | |
void | dateEntered (QDate) |
This signal is emitted when enter is pressed and a VALID date has been entered before into the line edit. | |
void | tableClicked () |
This signal is emitted when the day has been selected by clicking on it in the table. | |
Public Member Functions | |
KDatePicker (const QString &calType="gregorian", QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0) | |
The usual constructor. | |
virtual | ~KDatePicker () |
The destructor. | |
QSize | sizeHint () const |
The size hint for date pickers. | |
bool | setDate (const QDate &) |
Sets the date. | |
const QDate & | getDate () const |
Returns the selected date. | |
const QDate & | date () const |
void | setEnabled (bool) |
Enables or disables the widget. | |
void | setFontSize (int) |
Sets the font size of the widgets elements. | |
int | fontSize () const |
Returns the font size of the widget elements. | |
Protected Slots | |
void | dateChangedSlot (QDate) |
void | tableClickedSlot () |
void | monthForwardClicked () |
void | monthBackwardClicked () |
void | yearForwardClicked () |
void | yearBackwardClicked () |
void | selectMonthClicked () |
void | selectYearClicked () |
void | lineEnterPressed () |
Protected Member Functions | |
void | resizeEvent (QResizeEvent *) |
the resize event | |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
QToolButton * | yearForward |
the year forward button | |
QToolButton * | yearBackward |
the year backward button | |
QToolButton * | monthForward |
the month forward button | |
QToolButton * | monthBackward |
the month backward button | |
QToolButton * | selectMonth |
the button for selecting the month directly | |
QToolButton * | selectYear |
the button for selecting the year directly | |
QLineEdit * | line |
the line edit to enter the date directly | |
KDateValidator * | val |
the validator for the line edit: | |
KDateTable * | table |
the date table | |
QSize | maxMonthRect |
the widest month string in pixels: | |
KCalendarSystem * | calendarSystem |
Detailed Description
Provides a widget for calendar date input. A date selection widget.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.
KDatePicker
- Version:
- Id
- mkdatepicker.h,v 1.2 2002/06/26 22:43:01 cschumac Exp
- Author:
- Tim Gilman, Mirko Boehm
Definition at line 51 of file mkdatepicker.h.
Constructor & Destructor Documentation
|
The usual constructor. The given date will be displayed initially. Definition at line 42 of file mkdatepicker.cpp. References dateChanged(), QString::fromLatin1(), line, monthBackward, monthForward, selectMonth, selectYear, setDate(), setFontSize(), QLineEdit::setValidator(), table, tableClicked(), val, yearBackward, and yearForward. |
|
The destructor.
Definition at line 83 of file mkdatepicker.cpp. |
Member Function Documentation
|
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 393 of file mkdatepicker.cpp. References QSize::height(), line, maxMonthRect, monthBackward, monthForward, selectMonth, selectYear, QLineEdit::sizeHint(), QWidget::sizeHint(), KDateTable::sizeHint(), table, QSize::width(), yearBackward, and yearForward. |
|
Sets the date.
Definition at line 165 of file mkdatepicker.cpp. References KCalendarSystem::formatDate(), QDate::isValid(), line, KCalendarSystem::monthName(), selectMonth, selectYear, KDateTable::setDate(), QString::setNum(), QLineEdit::setText(), table, and KCalendarSystem::year(). Referenced by KDatePicker(). |
|
Returns the selected date. This class or method is obsolete, it is provided for compatibility only. Definition at line 153 of file mkdatepicker.cpp. References KDateTable::getDate(), and table. |
|
Definition at line 159 of file mkdatepicker.cpp. References KDateTable::getDate(), and table. |
|
Enables or disables the widget.
Definition at line 361 of file mkdatepicker.cpp. References line, monthBackward, monthForward, selectMonth, selectYear, QWidget::setEnabled(), table, yearBackward, and yearForward. |
|
Sets the font size of the widgets elements.
Definition at line 426 of file mkdatepicker.cpp. References QFontMetrics::boundingRect(), QWidget::font(), QSize::height(), QRect::height(), maxMonthRect, KCalendarSystem::monthName(), selectMonth, selectYear, KDateTable::setFontSize(), QSize::setHeight(), QFont::setPointSize(), QSize::setWidth(), table, QSize::width(), and QRect::width(). Referenced by KDatePicker(). |
|
Returns the font size of the widget elements.
Definition at line 108 of file mkdatepicker.h. |
|
the resize event
Reimplemented from QFrame. Definition at line 88 of file mkdatepicker.cpp. References line, monthBackward, monthForward, selectMonth, selectYear, QWidget::setGeometry(), QSize::setWidth(), QLineEdit::sizeHint(), QWidget::sizeHint(), table, QSize::width(), yearBackward, and yearForward. |
|
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.
Referenced by KDatePicker(). |
|
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. |
|
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. |
|
This signal is emitted when the day has been selected by clicking on it in the table.
Referenced by KDatePicker(). |
Member Data Documentation
|
the year forward button
Definition at line 115 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint(). |
|
the year backward button
Definition at line 117 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint(). |
|
the month forward button
Definition at line 119 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint(). |
|
the month backward button
Definition at line 121 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint(). |
|
the button for selecting the month directly
Definition at line 123 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setDate(), setEnabled(), setFontSize(), and sizeHint(). |
|
the button for selecting the year directly
Definition at line 125 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setDate(), setEnabled(), setFontSize(), and sizeHint(). |
|
the line edit to enter the date directly
Definition at line 127 of file mkdatepicker.h. Referenced by KDatePicker(), resizeEvent(), setDate(), setEnabled(), and sizeHint(). |
|
the validator for the line edit:
Definition at line 129 of file mkdatepicker.h. Referenced by KDatePicker(). |
|
the date table
Definition at line 131 of file mkdatepicker.h. Referenced by date(), getDate(), KDatePicker(), resizeEvent(), setDate(), setEnabled(), setFontSize(), and sizeHint(). |
|
the widest month string in pixels:
Definition at line 135 of file mkdatepicker.h. Referenced by setFontSize(), and sizeHint(). |
The documentation for this class was generated from the following files: