KDateTable Class Reference
#include <kdatetbl.h>
Inheritance diagram for KDateTable:

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)
For internal use only.
- Version:
- Id
- kdatetbl.h 565029 2006-07-22 07:30:24Z kling
- Author:
- Tim Gilman, Mirko Boehm
Definition at line 263 of file kdatetbl.h.
Public Types | |
enum | BackgroundMode { NoBgMode = 0, RectangleMode, CircleMode } |
Signals | |
void | dateChanged (QDate) |
void | dateChanged (const QDate &cur, const QDate &old) |
void | tableClicked () |
void | aboutToShowContextMenu (KPopupMenu *menu, const QDate &date) |
Public Member Functions | |
KDateTable (QWidget *parent=0, QDate date=QDate::currentDate(), const char *name=0, WFlags f=0) | |
KDateTable (QWidget *parent, const char *name, WFlags f=0) | |
~KDateTable () | |
virtual QSize | sizeHint () const |
void | setFontSize (int size) |
bool | setDate (const QDate &) |
const QDate & | getDate () const |
void | setPopupMenuEnabled (bool enable) |
bool | popupMenuEnabled () const |
void | setCustomDatePainting (const QDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()) |
void | unsetCustomDatePainting (const QDate &date) |
Protected Member Functions | |
int | posFromDate (const QDate &date) |
QDate | dateFromPos (int pos) |
virtual void | paintCell (QPainter *, int, int) |
virtual void | paintEmptyArea (QPainter *, int, int, int, int) |
virtual void | viewportResizeEvent (QResizeEvent *) |
virtual void | contentsMousePressEvent (QMouseEvent *) |
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 |
int | firstday |
int | numdays |
int | numDaysPrevMonth |
bool | unused_hasSelection |
QRect | maxCell |
Properties | |
QDate | date |
bool | popupMenu |
Constructor & Destructor Documentation
|
The constructor.
Definition at line 116 of file kdatetbl.cpp. |
|
The constructor.
Definition at line 137 of file kdatetbl.cpp. |
|
The destructor.
Definition at line 152 of file kdatetbl.cpp. |
Member Function Documentation
|
A popup menu for a given date is about to be shown (as when the user right clicks on that date and the popup menu is enabled). Connect the slot where you fill the menu to this signal.
|
|
React on mouse clicks that select a date.
Definition at line 454 of file kdatetbl.cpp. |
|
This function behaves essentially like the one above. The selected date changed.
|
|
The selected date changed.
|
|
calculate the date that is displayed at a given cell in the matrix. pos is the 0-based index in the matrix. Inverse function to posForDate(). Definition at line 181 of file kdatetbl.cpp. |
|
Paint a cell.
Reimplemented from QGridView. Definition at line 211 of file kdatetbl.cpp. |
|
Paint the empty area (background).
Reimplemented from QGridView. Definition at line 197 of file kdatetbl.cpp. |
|
Returns if the popup menu is enabled or not.
Definition at line 580 of file kdatetbl.cpp. |
|
calculate the position of the cell in the matrix for the given date. The result is the 0-based index. Definition at line 169 of file kdatetbl.cpp. |
|
Makes a given date be painted with a given foregroundColor, and background (a rectangle, or a circle/ellipse) in a given color.
Definition at line 585 of file kdatetbl.cpp. |
|
Select and display this date.
Definition at line 509 of file kdatetbl.cpp. |
|
Set the font size of the date table.
Definition at line 423 of file kdatetbl.cpp. |
|
Enables a popup menu when right clicking on a date. When it's enabled, this object emits a aboutToShowContextMenu signal where you can fill in the menu items.
Definition at line 575 of file kdatetbl.cpp. |
|
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 563 of file kdatetbl.cpp. |
|
A date has been selected by clicking on the table.
|
|
Unsets the custom painting of a date so that the date is painted as usual.
Definition at line 603 of file kdatetbl.cpp. |
|
Handle the resize events.
Definition at line 414 of file kdatetbl.cpp. |
Member Data Documentation
|
The day of the first day in the month [1. .7]. Definition at line 385 of file kdatetbl.h. |
|
The font size of the displayed text.
Definition at line 377 of file kdatetbl.h. |
|
Save the size of the largest used cell content.
Definition at line 402 of file kdatetbl.h. |
|
The number of days in the current month.
Definition at line 389 of file kdatetbl.h. |
|
The number of days in the previous month.
Definition at line 393 of file kdatetbl.h. |
|
unused ### remove in KDE 4.0
Definition at line 398 of file kdatetbl.h. |
Property Documentation
|
The currently selected date.
Definition at line 266 of file kdatetbl.h. |
The documentation for this class was generated from the following files: