KDateTable Class Reference
Date selection table. More...
#include <kdatetbl.h>
Inheritance diagram for KDateTable:

Signals | |
void | dateChanged (QDate) |
The selected date changed. | |
void | tableClicked () |
A date has been selected by clicking on the table. | |
Public Member Functions | |
KDateTable (QWidget *parent=0, QDate date=QDate::currentDate(), const char *name=0, WFlags f=0) | |
The constructor. | |
virtual QSize | sizeHint () const |
Returns a recommended size for the widget. | |
void | setFontSize (int size) |
Set the font size of the date table. | |
bool | setDate (const QDate &) |
Select and display this date. | |
const QDate & | getDate () const |
Protected Member Functions | |
virtual void | paintCell (QPainter *, int, int) |
Paint a cell. | |
virtual void | viewportResizeEvent (QResizeEvent *) |
Handle the resize events. | |
virtual void | contentsMousePressEvent (QMouseEvent *) |
React on mouse clicks that select a date. | |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | focusInEvent (QFocusEvent *e) |
virtual void | focusOutEvent (QFocusEvent *e) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
int | fontsize |
The font size of the displayed text. | |
QDate | date |
The currently selected date. | |
int | firstday |
The day of the first day in the month [1..7]. | |
int | numdays |
The number of days in the current month. | |
int | numDaysPrevMonth |
The number of days in the previous month. | |
bool | unused_hasSelection |
unused ### remove in KDE 4.0 | |
QRect | maxCell |
Save the size of the largest used cell content. |
Detailed Description
Date selection table.This is a support class for the KDatePicker class. It just draws the calender table without titles, but could theoretically be used as a standalone.
When a date is selected by the user, it emits a signal: dateSelected(QDate)
Definition at line 245 of file kdatetbl.h.
Constructor & Destructor Documentation
|
The constructor.
Definition at line 81 of file kdatetbl.cpp. References KGlobalSettings::baseColor(), QDate::currentDate(), QDate::isValid(), KStdAccel::name(), setDate(), setFontSize(), QGridView::setNumCols(), and QGridView::setNumRows(). |
Member Function Documentation
|
Returns a recommended size for the widget. To save some time, the size of the largest used cell content is calculated in each paintCell() call, since all calculations have to be done there anyway. The size is stored in maxCell. The sizeHint() simply returns a multiple of maxCell. Definition at line 408 of file kdatetbl.cpp. References QRect::height(), maxCell, QGridView::numCols(), QGridView::numRows(), and QRect::width(). Referenced by KDatePicker::sizeHint(). |
|
Set the font size of the date table.
Definition at line 265 of file kdatetbl.cpp. References QFontMetrics::boundingRect(), fontsize, QString::fromLatin1(), QRect::height(), KGlobal::locale(), maxCell, QRect::setHeight(), QRect::setWidth(), and QRect::width(). Referenced by KDateTable(), and KDatePicker::setFontSize(). |
|
Select and display this date.
Definition at line 354 of file kdatetbl.cpp. References date, dateChanged(), QDate::dayOfWeek(), QDate::daysInMonth(), firstday, QDate::isValid(), QDate::month(), numdays, numDaysPrevMonth, QDate::setYMD(), and QDate::year(). Referenced by contentsMousePressEvent(), KDateTable(), and KDatePicker::setDate(). |
|
|
Handle the resize events.
Definition at line 256 of file kdatetbl.cpp. References QGridView::setCellHeight(), and QGridView::setCellWidth(). |
|
React on mouse clicks that select a date.
Definition at line 295 of file kdatetbl.cpp. 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(). |
|
The selected date changed.
Referenced by setDate(). |
|
A date has been selected by clicking on the table.
Referenced by contentsMousePressEvent(). |
Member Data Documentation
|
The font size of the displayed text.
Definition at line 294 of file kdatetbl.h. Referenced by paintCell(), and setFontSize(). |
|
The currently selected date.
Definition at line 298 of file kdatetbl.h. Referenced by contentsMousePressEvent(), paintCell(), and setDate(). |
|
The day of the first day in the month [1..7].
Definition at line 302 of file kdatetbl.h. Referenced by contentsMousePressEvent(), paintCell(), and setDate(). |
|
The number of days in the current month.
Definition at line 306 of file kdatetbl.h. Referenced by contentsMousePressEvent(), paintCell(), and setDate(). |
|
The number of days in the previous month.
Definition at line 310 of file kdatetbl.h. Referenced by paintCell(), and setDate(). |
|
unused ### remove in KDE 4.0
Definition at line 315 of file kdatetbl.h. |
|
Save the size of the largest used cell content.
Definition at line 319 of file kdatetbl.h. Referenced by paintCell(), setFontSize(), and sizeHint(). |
The documentation for this class was generated from the following files: