KODayMatrix Class Reference
replacement for kdpdatebuton.cpp that used 42 widgets for the day matrix to be displayed. day matrix widget of the KDateNavigator More...
#include <kodaymatrix.h>
Inheritance diagram for KODayMatrix:

Public Slots | |
void | updateView () |
Recalculates all the flags of the days in the matrix like holidays or events on a day (Actually calls above method with the actual startdate). | |
void | recalculateToday () |
Calculate which square in the matrix should be hilighted to indicate it's today. | |
Signals | |
void | selected (const KCal::DateList &daylist) |
emitted if the user selects a block of days with the mouse by dragging a rectangle inside the matrix | |
void | eventDropped (Event *event) |
emitted if the user has dropped an event inside the matrix | |
Public Member Functions | |
KODayMatrix (QWidget *parent, Calendar *calendar, QDate date, const char *name) | |
constructor to create a day matrix widget. | |
~KODayMatrix () | |
destructor that deallocates all dynamically allocated private members. | |
void | updateView (QDate actdate) |
updates the day matrix to start with the given date. | |
const QDate & | getDate (int offset) |
returns the QDate object associated with day indexed by the supplied offset. | |
QString | getHolidayLabel (int offset) |
returns the official name of this holy day or 0 if there is no label for this day. | |
void | addSelectedDaysTo (DateList &) |
adds all actual selected days from mSelStart to mSelEnd to the supplied DateList. | |
void | setSelectedDaysFrom (const QDate &start, const QDate &end) |
sets the actual to be displayed selection in the day matrix starting from start and ending with end. | |
bool | isTodayVisible () const |
Is today visible in the view? Keep this in sync with the values today (below) can take. | |
bool | isBeginningOfMonth () const |
If today is visible, then we can find out if today is near the beginning or the end of the month. | |
bool | isEndOfMonth () const |
Protected Member Functions | |
void | paintEvent (QPaintEvent *ev) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *e) |
void | mouseMoveEvent (QMouseEvent *e) |
void | dragEnterEvent (QDragEnterEvent *) |
void | dragMoveEvent (QDragMoveEvent *) |
void | dragLeaveEvent (QDragLeaveEvent *) |
void | dropEvent (QDropEvent *) |
void | resizeEvent (QResizeEvent *) |
Detailed Description
replacement for kdpdatebuton.cpp that used 42 widgets for the day matrix to be displayed. day matrix widget of the KDateNavigatorCornelius thought this was a waste of memory and a lot of overhead. In addition the selection was not very intuitive so I decided to rewrite it using a QFrame that draws the labels and allows for dragging selection while maintaining nearly full compatibility in behaviour with its predecessor.
The following functionality has been changed:
o when shifting events in the agenda view from one day to another the day matrix is updated now o TODO ET dragging an event to the matrix will MOVE not COPY the event to the new date. o no support for Ctrl+click to create groups of dates (This has not really been supported in the predecessor. It was not very intuitive nor was it user friendly.) This feature has been replaced with dragging a selection on the matrix. The matrix will automatically choose the appropriate selection (e.g. you are not any longer able to select two distinct groups of date selections as in the old class) o now that you can select more then a week it can happen that not all selected days are displayed in the matrix. However this is preferred to the alternative which would mean to adjust the selection and leave some days undisplayed while scrolling through the months
- Author:
- Eitzenberger Thomas
Definition at line 103 of file kodaymatrix.h.
Constructor & Destructor Documentation
|
constructor to create a day matrix widget.
Definition at line 85 of file kodaymatrix.cpp. References updateView(). |
|
destructor that deallocates all dynamically allocated private members.
Definition at line 124 of file kodaymatrix.cpp. |
Member Function Documentation
|
updates the day matrix to start with the given date. Does all the necessary checks for holidays or events on a day and stores them for display later on. Does NOT update the view visually. Call repaint() for this.
Definition at line 202 of file kodaymatrix.cpp. References QPtrList::count(), QDate::daysTo(), QPtrList::first(), QString::isEmpty(), QString::isNull(), QPtrList::next(), and recalculateToday(). |
|
returns the QDate object associated with day indexed by the supplied offset.
Definition at line 270 of file kodaymatrix.cpp. |
|
returns the official name of this holy day or 0 if there is no label for this day.
Definition at line 279 of file kodaymatrix.cpp. Referenced by DynamicTip::maybeTip(). |
|
adds all actual selected days from mSelStart to mSelEnd to the supplied DateList.
Definition at line 139 of file kodaymatrix.cpp. |
|
sets the actual to be displayed selection in the day matrix starting from start and ending with end. Theview must be manually updated by calling repaint. (?) Definition at line 173 of file kodaymatrix.cpp. References QDate::daysTo(). |
|
Is today visible in the view? Keep this in sync with the values today (below) can take.
Definition at line 158 of file kodaymatrix.h. |
|
If today is visible, then we can find out if today is near the beginning or the end of the month. This is dependent on today remaining the index in the array of visible dates and going from top left (0) to bottom right (41). Definition at line 166 of file kodaymatrix.h. |
|
Recalculates all the flags of the days in the matrix like holidays or events on a day (Actually calls above method with the actual startdate).
Definition at line 197 of file kodaymatrix.cpp. Referenced by KODayMatrix(). |
|
Calculate which square in the matrix should be hilighted to indicate it's today.
Definition at line 180 of file kodaymatrix.cpp. References QDate::addDays(), QDate::currentDate(), QDate::day(), QDate::month(), QString::number(), and QDate::year(). Referenced by updateView(). |
|
emitted if the user selects a block of days with the mouse by dragging a rectangle inside the matrix
|
|
emitted if the user has dropped an event inside the matrix
|
The documentation for this class was generated from the following files: