.TH "KDateTable" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDateTable \- Date selection table.  

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

.in +1c
.ti -1c
.RI "void \fBdateChanged\fP (\fBQDate\fP)"
.br
.RI "\fIThe selected date changed. \fP"
.ti -1c
.RI "void \fBtableClicked\fP ()"
.br
.RI "\fIA date has been selected by clicking on the table. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDateTable\fP (\fBQWidget\fP *parent=0, \fBQDate\fP \fBdate\fP=\fBQDate::currentDate\fP(), const  char *name=0, WFlags f=0)"
.br
.RI "\fIThe constructor. \fP"
.ti -1c
.RI "virtual \fBQSize\fP \fBsizeHint\fP () const "
.br
.RI "\fIReturns a recommended size for the widget. \fP"
.ti -1c
.RI "void \fBsetFontSize\fP (int size)"
.br
.RI "\fISet the font size of the date table. \fP"
.ti -1c
.RI "bool \fBsetDate\fP (const  \fBQDate\fP &)"
.br
.RI "\fISelect and display this date. \fP"
.ti -1c
.RI "const  \fBQDate\fP & \fBgetDate\fP () const "
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBpaintCell\fP (\fBQPainter\fP *, int, int)"
.br
.RI "\fIPaint a cell. \fP"
.ti -1c
.RI "virtual void \fBviewportResizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.RI "\fIHandle the resize events. \fP"
.ti -1c
.RI "virtual void \fBcontentsMousePressEvent\fP (\fBQMouseEvent\fP *)"
.br
.RI "\fIReact on mouse clicks that select a date. \fP"
.ti -1c
.RI "virtual void \fBwheelEvent\fP (\fBQWheelEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBkeyPressEvent\fP (\fBQKeyEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBfocusInEvent\fP (\fBQFocusEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBfocusOutEvent\fP (\fBQFocusEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "int \fBfontsize\fP"
.br
.RI "\fIThe font size of the displayed text. \fP"
.ti -1c
.RI "\fBQDate\fP \fBdate\fP"
.br
.RI "\fIThe currently selected date. \fP"
.ti -1c
.RI "int \fBfirstday\fP"
.br
.RI "\fIThe day of the first day in the month [1..7]. \fP"
.ti -1c
.RI "int \fBnumdays\fP"
.br
.RI "\fIThe number of days in the current month. \fP"
.ti -1c
.RI "int \fBnumDaysPrevMonth\fP"
.br
.RI "\fIThe number of days in the previous month. \fP"
.ti -1c
.RI "bool \fBunused_hasSelection\fP"
.br
.RI "\fIunused ### remove in \fBKDE\fP 4.0 \fP"
.ti -1c
.RI "\fBQRect\fP \fBmaxCell\fP"
.br
.RI "\fISave the size of the largest used cell content. \fP"
.in -1c
.SH "Detailed Description"
.PP 
Date selection table. 

This is a support class for the \fBKDatePicker\fP class. It just draws the calender table without titles, but could theoretically be used as a standalone.
.PP
When a date is selected by the user, it emits a signal: dateSelected(QDate) 
.PP
Definition at line 245 of file kdatetbl.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDateTable::KDateTable (\fBQWidget\fP * parent = 0, \fBQDate\fP date = \fBQDate::currentDate\fP(), const char * name = 0, WFlags f = 0)"
.PP
The constructor. Definition at line 81 of file kdatetbl.cpp.
.PP
References KGlobalSettings::baseColor(), QDate::currentDate(), QDate::isValid(), KStdAccel::name(), setDate(), setFontSize(), QGridView::setNumCols(), and QGridView::setNumRows().
.SH "Member Function Documentation"
.PP 
.SS "\fBQSize\fP KDateTable::sizeHint () const\fC [virtual]\fP"
.PP
Returns a recommended size for the widget. To save some time, the size of the largest used cell content is calculated in each \fBpaintCell()\fP call, since all calculations have to be done there anyway. The size is stored in maxCell. The \fBsizeHint()\fP simply returns a multiple of maxCell. Definition at line 408 of file kdatetbl.cpp.
.PP
References QRect::height(), maxCell, QGridView::numCols(), QGridView::numRows(), and QRect::width().
.PP
Referenced by KDatePicker::sizeHint().
.SS "void KDateTable::setFontSize (int size)"
.PP
Set the font size of the date table. Definition at line 265 of file kdatetbl.cpp.
.PP
References QFontMetrics::boundingRect(), fontsize, QString::fromLatin1(), QRect::height(), KGlobal::locale(), maxCell, QRect::setHeight(), QRect::setWidth(), and QRect::width().
.PP
Referenced by KDateTable(), and KDatePicker::setFontSize().
.SS "bool KDateTable::setDate (const \fBQDate\fP &)"
.PP
Select and display this date. Definition at line 354 of file kdatetbl.cpp.
.PP
References date, dateChanged(), QDate::dayOfWeek(), QDate::daysInMonth(), firstday, QDate::isValid(), QDate::month(), numdays, numDaysPrevMonth, QDate::setYMD(), and QDate::year().
.PP
Referenced by contentsMousePressEvent(), KDateTable(), and KDatePicker::setDate().
.SS "void KDateTable::paintCell (\fBQPainter\fP *, int, int)\fC [protected, virtual]\fP"
.PP
Paint a cell. Reimplemented from \fBQGridView\fP.
.PP
Definition at line 100 of file kdatetbl.cpp.
.PP
References KGlobalSettings::activeTextColor(), KGlobalSettings::activeTitleColor(), KGlobalSettings::baseColor(), KGlobalSettings::calculateAlternateBackgroundColor(), QGridView::cellHeight(), QGridView::cellWidth(), QDate::currentDate(), date, QDate::day(), QPainter::drawRect(), QPainter::drawText(), firstday, fontsize, KGlobalSettings::generalFont(), QRect::height(), KGlobalSettings::highlightColor(), KGlobal::locale(), maxCell, QDate::month(), numdays, numDaysPrevMonth, QPainter::pen(), QFont::setBold(), QPainter::setBrush(), QPainter::setFont(), QRect::setHeight(), QString::setNum(), QPainter::setPen(), QFont::setPointSize(), QRect::setWidth(), KGlobalSettings::textColor(), KLocale::weekDayName(), KLocale::weekStartDay(), QRect::width(), and QDate::year().
.SS "void KDateTable::viewportResizeEvent (\fBQResizeEvent\fP *)\fC [protected, virtual]\fP"
.PP
Handle the resize events. Definition at line 256 of file kdatetbl.cpp.
.PP
References QGridView::setCellHeight(), and QGridView::setCellWidth().
.SS "void KDateTable::contentsMousePressEvent (\fBQMouseEvent\fP *)\fC [protected, virtual]\fP"
.PP
React on mouse clicks that select a date. Definition at line 295 of file kdatetbl.cpp.
.PP
References QDate::addDays(), KNotifyClient::beep(), QGridView::columnAt(), date, QDate::day(), firstday, KGlobal::locale(), QDate::month(), numdays, QMouseEvent::pos(), QGridView::rowAt(), setDate(), tableClicked(), QGridView::updateCell(), KLocale::weekStartDay(), QPoint::x(), QPoint::y(), and QDate::year().
.SS "void KDateTable::dateChanged (\fBQDate\fP)\fC [signal]\fP"
.PP
The selected date changed. Referenced by setDate().
.SS "void KDateTable::tableClicked ()\fC [signal]\fP"
.PP
A date has been selected by clicking on the table. Referenced by contentsMousePressEvent().
.SH "Member Data Documentation"
.PP 
.SS "int \fBKDateTable::fontsize\fP\fC [protected]\fP"
.PP
The font size of the displayed text. Definition at line 294 of file kdatetbl.h.
.PP
Referenced by paintCell(), and setFontSize().
.SS "\fBQDate\fP \fBKDateTable::date\fP\fC [protected]\fP"
.PP
The currently selected date. Definition at line 298 of file kdatetbl.h.
.PP
Referenced by contentsMousePressEvent(), paintCell(), and setDate().
.SS "int \fBKDateTable::firstday\fP\fC [protected]\fP"
.PP
The day of the first day in the month [1..7]. Definition at line 302 of file kdatetbl.h.
.PP
Referenced by contentsMousePressEvent(), paintCell(), and setDate().
.SS "int \fBKDateTable::numdays\fP\fC [protected]\fP"
.PP
The number of days in the current month. Definition at line 306 of file kdatetbl.h.
.PP
Referenced by contentsMousePressEvent(), paintCell(), and setDate().
.SS "int \fBKDateTable::numDaysPrevMonth\fP\fC [protected]\fP"
.PP
The number of days in the previous month. Definition at line 310 of file kdatetbl.h.
.PP
Referenced by paintCell(), and setDate().
.SS "bool \fBKDateTable::unused_hasSelection\fP\fC [protected]\fP"
.PP
unused ### remove in \fBKDE\fP 4.0 Definition at line 315 of file kdatetbl.h.
.SS "\fBQRect\fP \fBKDateTable::maxCell\fP\fC [protected]\fP"
.PP
Save the size of the largest used cell content. Definition at line 319 of file kdatetbl.h.
.PP
Referenced by paintCell(), setFontSize(), and sizeHint().

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