.TH "KDatePicker" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDatePicker \- Provides a widget for calendar date input. A date selection widget.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kdatepicker.h>\fP
.PP
Inherits \fBQFrame\fP.
.PP
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBdateChanged\fP (\fBQDate\fP)"
.br
.RI "\fIThis signal is emitted each time the selected date is changed. \fP"
.ti -1c
.RI "void \fBdateSelected\fP (\fBQDate\fP)"
.br
.RI "\fIThis signal is emitted each time a day has been selected by clicking on the table (hitting a day in the current month). \fP"
.ti -1c
.RI "void \fBdateEntered\fP (\fBQDate\fP)"
.br
.RI "\fIThis signal is emitted when enter is pressed and a VALID date has been entered before into the line edit. \fP"
.ti -1c
.RI "void \fBtableClicked\fP ()"
.br
.RI "\fIThis signal is emitted when the day has been selected by clicking on it in the table. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDatePicker\fP (\fBQWidget\fP *parent=0, \fBQDate\fP=\fBQDate::currentDate\fP(), const  char *name=0)"
.br
.RI "\fIThe usual constructor. \fP"
.ti -1c
.RI "\fBKDatePicker\fP (\fBQWidget\fP *parent, \fBQDate\fP, const  char *name, WFlags f)"
.br
.RI "\fIThe usual constructor. \fP"
.ti -1c
.RI "\fBKDatePicker\fP (\fBQWidget\fP *parent, const  char *name)"
.br
.RI "\fIStandard qt widget constructor. \fP"
.ti -1c
.RI "virtual \fB~KDatePicker\fP ()"
.br
.RI "\fIThe destructor. \fP"
.ti -1c
.RI "\fBQSize\fP \fBsizeHint\fP () const "
.br
.RI "\fIThe size hint for date pickers. \fP"
.ti -1c
.RI "bool \fBsetDate\fP (const  \fBQDate\fP &)"
.br
.RI "\fISets the date. \fP"
.ti -1c
.RI "const  \fBQDate\fP & \fBgetDate\fP () const "
.br
.RI "\fIReturns the selected date. \fP"
.ti -1c
.RI "const  \fBQDate\fP & \fBdate\fP () const "
.br
.ti -1c
.RI "void \fBsetEnabled\fP (bool)"
.br
.RI "\fIEnables or disables the widget. \fP"
.ti -1c
.RI "void \fBsetFontSize\fP (int)"
.br
.RI "\fISets the font size of the widgets elements. \fP"
.ti -1c
.RI "int \fBfontSize\fP () const "
.br
.RI "\fIReturns the font size of the widget elements. \fP"
.ti -1c
.RI "void \fBsetCloseButton\fP (bool enable)"
.br
.RI "\fIBy calling this method with \fCenable\fP = true, KDatePicker will show a little close-button in the upper button-row. \fP"
.ti -1c
.RI "bool \fBhasCloseButton\fP () const "
.br
.in -1c
.SS "Protected Slots"

.in +1c
.ti -1c
.RI "void \fBdateChangedSlot\fP (\fBQDate\fP)"
.br
.ti -1c
.RI "void \fBtableClickedSlot\fP ()"
.br
.ti -1c
.RI "void \fBmonthForwardClicked\fP ()"
.br
.ti -1c
.RI "void \fBmonthBackwardClicked\fP ()"
.br
.ti -1c
.RI "void \fByearForwardClicked\fP ()"
.br
.ti -1c
.RI "void \fByearBackwardClicked\fP ()"
.br
.ti -1c
.RI "void \fBselectWeekClicked\fP ()"
.br
.RI "\fI\fBSince:\fP
.RS 4
3.1 
.RE
.PP
\fP"
.ti -1c
.RI "void \fBselectMonthClicked\fP ()"
.br
.ti -1c
.RI "void \fBselectYearClicked\fP ()"
.br
.ti -1c
.RI "void \fBlineEnterPressed\fP ()"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *o, \fBQEvent\fP *e)"
.br
.RI "\fIto catch move keyEvents when \fBQLineEdit\fP has keyFocus \fP"
.ti -1c
.RI "virtual void \fBresizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.RI "\fIthe resize event \fP"
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "\fBQToolButton\fP * \fByearForward\fP"
.br
.RI "\fIthe year forward button \fP"
.ti -1c
.RI "\fBQToolButton\fP * \fByearBackward\fP"
.br
.RI "\fIthe year backward button \fP"
.ti -1c
.RI "\fBQToolButton\fP * \fBmonthForward\fP"
.br
.RI "\fIthe month forward button \fP"
.ti -1c
.RI "\fBQToolButton\fP * \fBmonthBackward\fP"
.br
.RI "\fIthe month backward button \fP"
.ti -1c
.RI "\fBQToolButton\fP * \fBselectMonth\fP"
.br
.RI "\fIthe button for selecting the month directly \fP"
.ti -1c
.RI "\fBQToolButton\fP * \fBselectYear\fP"
.br
.RI "\fIthe button for selecting the year directly \fP"
.ti -1c
.RI "\fBQLineEdit\fP * \fBline\fP"
.br
.RI "\fIthe line edit to enter the date directly \fP"
.ti -1c
.RI "\fBKDateValidator\fP * \fBval\fP"
.br
.RI "\fIthe validator for the line edit: \fP"
.ti -1c
.RI "\fBKDateTable\fP * \fBtable\fP"
.br
.RI "\fIthe date table \fP"
.ti -1c
.RI "\fBQSize\fP \fBmaxMonthRect\fP"
.br
.RI "\fIthe widest month string in pixels: \fP"
.in -1c
.SH "Detailed Description"
.PP 
Provides a widget for calendar date input. A date selection widget. 

Different from the previous versions, it now emits two types of signals, either \fBdateSelected\fP() or \fBdateEntered\fP() (see documentation for both signals).
.PP
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.
.PP
KDE Date Widget 
.PP
\fBVersion:\fP
.RS 4

.PP
\fBId\fP.RS 4
\fBkdatepicker.h\fP,v 1.30 2002/09/28 15:16:22 tjansen Exp 
.RE
.PP
.RE
.PP
\fBAuthor:\fP
.RS 4
Tim Gilman, Mirko Boehm
.RE
.PP

.PP
Definition at line 49 of file kdatepicker.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDatePicker::KDatePicker (\fBQWidget\fP * parent = 0, \fBQDate\fP = \fBQDate::currentDate\fP(), const char * name = 0)"
.PP
The usual constructor. The given date will be displayed initially. Definition at line 50 of file kdatepicker.cpp.
.PP
References KStdAccel::name().
.SS "KDatePicker::KDatePicker (\fBQWidget\fP * parent, \fBQDate\fP, const char * name, WFlags f)"
.PP
The usual constructor. The given date will be displayed initially. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 56 of file kdatepicker.cpp.
.PP
References KStdAccel::name().
.SS "KDatePicker::KDatePicker (\fBQWidget\fP * parent, const char * name)"
.PP
Standard qt widget constructor. The initial date will be the current date. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 62 of file kdatepicker.cpp.
.PP
References QDate::currentDate(), and KStdAccel::name().
.SS "KDatePicker::~\fBKDatePicker\fP ()\fC [virtual]\fP"
.PP
The destructor. Definition at line 114 of file kdatepicker.cpp.
.SH "Member Function Documentation"
.PP 
.SS "\fBQSize\fP KDatePicker::sizeHint () const"
.PP
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 396 of file kdatepicker.cpp.
.PP
References QSize::height(), line, maxMonthRect, monthBackward, monthForward, selectMonth, selectYear, QLineEdit::sizeHint(), QWidget::sizeHint(), KDateTable::sizeHint(), QApplication::style(), table, QSize::width(), yearBackward, and yearForward.
.SS "bool KDatePicker::setDate (const \fBQDate\fP &)"
.PP
Sets the date. \fBReturns:\fP
.RS 4
\fCfalse\fP and does not change anything if the date given is invalid. 
.RE
.PP
Definition at line 224 of file kdatepicker.cpp.
.PP
References QDate::isValid(), line, KGlobal::locale(), QDate::month(), selectMonth, selectYear, KDateTable::setDate(), QString::setNum(), QLineEdit::setText(), table, and QDate::year().
.PP
Referenced by selectWeekClicked().
.SS "const  \fBQDate\fP & KDatePicker::getDate () const"
.PP
Returns the selected date. \fBThis class or method is obsolete, it is provided for compatibility only.\fP Definition at line 212 of file kdatepicker.cpp.
.PP
References KDateTable::getDate(), and table.
.SS "const  \fBQDate\fP & KDatePicker::date () const"
.PP
\fBReturns:\fP
.RS 4
the selected date. 
.RE
.PP
Definition at line 218 of file kdatepicker.cpp.
.PP
References KDateTable::getDate(), and table.
.SS "void KDatePicker::setEnabled (bool)"
.PP
Enables or disables the widget. Definition at line 364 of file kdatepicker.cpp.
.PP
References line, monthBackward, monthForward, selectMonth, selectYear, QWidget::setEnabled(), table, yearBackward, and yearForward.
.SS "void KDatePicker::setFontSize (int)"
.PP
Sets the font size of the widgets elements. Definition at line 436 of file kdatepicker.cpp.
.PP
References QFontMetrics::boundingRect(), QWidget::font(), QSize::height(), QRect::height(), KGlobal::locale(), maxMonthRect, selectMonth, selectYear, KDateTable::setFontSize(), QSize::setHeight(), QFont::setPointSize(), QSize::setWidth(), table, QSize::width(), and QRect::width().
.SS "int KDatePicker::fontSize () const\fC [inline]\fP"
.PP
Returns the font size of the widget elements. Definition at line 123 of file kdatepicker.h.
.SS "void KDatePicker::setCloseButton (bool enable)"
.PP
By calling this method with \fCenable\fP = 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. 
.PP
\fBSee also:\fP
.RS 4
\fBhasCloseButton\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 469 of file kdatepicker.cpp.
.PP
References QToolTip::add(), and KStdAccel::close().
.SS "bool KDatePicker::hasCloseButton () const"
.PP
\fBReturns:\fP
.RS 4
true if a KDatePicker shows a close-button. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetCloseButton\fP 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 489 of file kdatepicker.cpp.
.SS "bool KDatePicker::eventFilter (\fBQObject\fP * o, \fBQEvent\fP * e)\fC [protected, virtual]\fP"
.PP
to catch move keyEvents when \fBQLineEdit\fP has keyFocus Definition at line 120 of file kdatepicker.cpp.
.PP
References QKeyEvent::key(), QApplication::sendEvent(), table, and QEvent::type().
.SS "void KDatePicker::resizeEvent (\fBQResizeEvent\fP *)\fC [protected, virtual]\fP"
.PP
the resize event Reimplemented from \fBQFrame\fP.
.PP
Definition at line 139 of file kdatepicker.cpp.
.PP
References line, maxMonthRect, monthBackward, monthForward, selectMonth, selectYear, QWidget::setGeometry(), QSize::setWidth(), QLineEdit::sizeHint(), QWidget::sizeHint(), QApplication::style(), table, QSize::width(), yearBackward, and yearForward.
.SS "void KDatePicker::selectWeekClicked ()\fC [protected, slot]\fP"
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 267 of file kdatepicker.cpp.
.PP
References QDate::addDays(), KNotifyClient::beep(), KStdAccel::close(), KPopupFrame::exec(), KDateTable::getDate(), KDateInternalWeekSelector::getWeek(), setDate(), KPopupFrame::setMainWidget(), QDate::setYMD(), QLineEdit::sizeHint(), table, and QDate::year().
.SS "void KDatePicker::dateChanged (\fBQDate\fP)\fC [signal]\fP"
.PP
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. 
.PP
\fBSee also:\fP
.RS 4
\fBdateSelected\fP 
.RE
.PP

.SS "void KDatePicker::dateSelected (\fBQDate\fP)\fC [signal]\fP"
.PP
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 \fBdateSelected()\fP in older versions of KDatePicker. 
.SS "void KDatePicker::dateEntered (\fBQDate\fP)\fC [signal]\fP"
.PP
This signal is emitted when enter is pressed and a VALID date has been entered before into the line edit. Connect to both \fBdateEntered()\fP and \fBdateSelected()\fP to receive all events where the user really enters a date. 
.SS "void KDatePicker::tableClicked ()\fC [signal]\fP"
.PP
This signal is emitted when the day has been selected by clicking on it in the table. 
.SH "Member Data Documentation"
.PP 
.SS "\fBQToolButton\fP* \fBKDatePicker::yearForward\fP\fC [protected]\fP"
.PP
the year forward button Definition at line 150 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setEnabled(), and sizeHint().
.SS "\fBQToolButton\fP* \fBKDatePicker::yearBackward\fP\fC [protected]\fP"
.PP
the year backward button Definition at line 152 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setEnabled(), and sizeHint().
.SS "\fBQToolButton\fP* \fBKDatePicker::monthForward\fP\fC [protected]\fP"
.PP
the month forward button Definition at line 154 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setEnabled(), and sizeHint().
.SS "\fBQToolButton\fP* \fBKDatePicker::monthBackward\fP\fC [protected]\fP"
.PP
the month backward button Definition at line 156 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setEnabled(), and sizeHint().
.SS "\fBQToolButton\fP* \fBKDatePicker::selectMonth\fP\fC [protected]\fP"
.PP
the button for selecting the month directly Definition at line 158 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setDate(), setEnabled(), setFontSize(), and sizeHint().
.SS "\fBQToolButton\fP* \fBKDatePicker::selectYear\fP\fC [protected]\fP"
.PP
the button for selecting the year directly Definition at line 160 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setDate(), setEnabled(), setFontSize(), and sizeHint().
.SS "\fBQLineEdit\fP* \fBKDatePicker::line\fP\fC [protected]\fP"
.PP
the line edit to enter the date directly Definition at line 162 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setDate(), setEnabled(), and sizeHint().
.SS "\fBKDateValidator\fP* \fBKDatePicker::val\fP\fC [protected]\fP"
.PP
the validator for the line edit: Definition at line 164 of file kdatepicker.h.
.SS "\fBKDateTable\fP* \fBKDatePicker::table\fP\fC [protected]\fP"
.PP
the date table Definition at line 166 of file kdatepicker.h.
.PP
Referenced by date(), eventFilter(), getDate(), resizeEvent(), selectWeekClicked(), setDate(), setEnabled(), setFontSize(), and sizeHint().
.SS "\fBQSize\fP \fBKDatePicker::maxMonthRect\fP\fC [protected]\fP"
.PP
the widest month string in pixels: Definition at line 170 of file kdatepicker.h.
.PP
Referenced by resizeEvent(), setFontSize(), and sizeHint().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
