kdeui
KDateTable Class Reference
Date selection table. More...
#include <kdatetbl.h>
Public Types | |
enum | BackgroundMode { NoBgMode = 0, RectangleMode, CircleMode } |
Signals | |
void | aboutToShowContextMenu (KPopupMenu *menu, const QDate &date) |
void | dateChanged (const QDate &cur, const QDate &old) |
void | dateChanged (QDate) |
void | tableClicked () |
Public Member Functions | |
const QDate & | getDate () const |
KDateTable (QWidget *parent, const char *name, WFlags f=0) | |
KDateTable (QWidget *parent=0, QDate date=QDate::currentDate(), const char *name=0, WFlags f=0) | |
bool | popupMenuEnabled () const |
void | setCustomDatePainting (const QDate &date, const QColor &fgColor, BackgroundMode bgMode=NoBgMode, const QColor &bgColor=QColor()) |
bool | setDate (const QDate &) |
void | setFontSize (int size) |
void | setPopupMenuEnabled (bool enable) |
virtual QSize | sizeHint () const |
void | unsetCustomDatePainting (const QDate &date) |
~KDateTable () | |
Protected Member Functions | |
virtual void | contentsMousePressEvent (QMouseEvent *) |
QDate | dateFromPos (int pos) |
virtual void | focusInEvent (QFocusEvent *e) |
virtual void | focusOutEvent (QFocusEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | paintCell (QPainter *, int, int) |
virtual void | paintEmptyArea (QPainter *, int, int, int, int) |
int | posFromDate (const QDate &date) |
virtual void | viewportResizeEvent (QResizeEvent *) |
virtual void | virtual_hook (int id, void *data) |
virtual void | wheelEvent (QWheelEvent *e) |
Protected Attributes | |
int | firstday |
int | fontsize |
QRect | maxCell |
int | numdays |
int | numDaysPrevMonth |
bool | unused_hasSelection |
Properties | |
QDate | date |
bool | popupMenu |
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
Definition at line 263 of file kdatetbl.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
KDateTable::KDateTable | ( | QWidget * | parent = 0 , |
|
QDate | date = QDate::currentDate() , |
|||
const char * | name = 0 , |
|||
WFlags | f = 0 | |||
) |
KDateTable::KDateTable | ( | QWidget * | parent, | |
const char * | name, | |||
WFlags | f = 0 | |||
) |
KDateTable::~KDateTable | ( | ) |
Member Function Documentation
void KDateTable::aboutToShowContextMenu | ( | KPopupMenu * | menu, | |
const QDate & | date | |||
) | [signal] |
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.
- Since:
- 3.2
void KDateTable::contentsMousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
This function behaves essentially like the one above.
The selected date changed.
- Parameters:
-
cur The current date old The date before the date was changed
void KDateTable::dateChanged | ( | QDate | ) | [signal] |
The selected date changed.
QDate KDateTable::dateFromPos | ( | int | pos | ) | [protected] |
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 182 of file kdatetbl.cpp.
void KDateTable::focusInEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
Definition at line 551 of file kdatetbl.cpp.
void KDateTable::focusOutEvent | ( | QFocusEvent * | e | ) | [protected, virtual] |
Definition at line 557 of file kdatetbl.cpp.
const QDate & KDateTable::getDate | ( | ) | const |
Definition at line 545 of file kdatetbl.cpp.
void KDateTable::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Definition at line 373 of file kdatetbl.cpp.
void KDateTable::paintCell | ( | QPainter * | painter, | |
int | row, | |||
int | col | |||
) | [protected, virtual] |
void KDateTable::paintEmptyArea | ( | QPainter * | paint, | |
int | , | |||
int | , | |||
int | , | |||
int | ||||
) | [protected, virtual] |
Paint the empty area (background).
Reimplemented from QGridView.
Definition at line 198 of file kdatetbl.cpp.
bool KDateTable::popupMenuEnabled | ( | ) | const |
int KDateTable::posFromDate | ( | const QDate & | date | ) | [protected] |
calculate the position of the cell in the matrix for the given date.
The result is the 0-based index.
Definition at line 170 of file kdatetbl.cpp.
void KDateTable::setCustomDatePainting | ( | const QDate & | date, | |
const QColor & | fgColor, | |||
BackgroundMode | bgMode = NoBgMode , |
|||
const QColor & | bgColor = QColor() | |||
) |
Makes a given date be painted with a given foregroundColor, and background (a rectangle, or a circle/ellipse) in a given color.
- Since:
- 3.2
Definition at line 586 of file kdatetbl.cpp.
bool KDateTable::setDate | ( | const QDate & | date_ | ) |
void KDateTable::setFontSize | ( | int | size | ) |
void KDateTable::setPopupMenuEnabled | ( | bool | enable | ) |
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.
- Since:
- 3.2
Definition at line 576 of file kdatetbl.cpp.
QSize KDateTable::sizeHint | ( | void | ) | const [virtual] |
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 564 of file kdatetbl.cpp.
void KDateTable::tableClicked | ( | ) | [signal] |
A date has been selected by clicking on the table.
void KDateTable::unsetCustomDatePainting | ( | const QDate & | date | ) |
Unsets the custom painting of a date so that the date is painted as usual.
- Since:
- 3.2
Definition at line 604 of file kdatetbl.cpp.
void KDateTable::viewportResizeEvent | ( | QResizeEvent * | e | ) | [protected, virtual] |
void KDateTable::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
Definition at line 1028 of file kdatetbl.cpp.
void KDateTable::wheelEvent | ( | QWheelEvent * | e | ) | [protected, virtual] |
Definition at line 448 of file kdatetbl.cpp.
Member Data Documentation
int KDateTable::firstday [protected] |
int KDateTable::fontsize [protected] |
QRect KDateTable::maxCell [protected] |
int KDateTable::numdays [protected] |
int KDateTable::numDaysPrevMonth [protected] |
bool KDateTable::unused_hasSelection [protected] |
Property Documentation
QDate KDateTable::date [read, write] |
bool KDateTable::popupMenu [read, write] |
Definition at line 267 of file kdatetbl.h.
The documentation for this class was generated from the following files: