kplato
KPlato::CalendarPanel Class Reference
#include <kptcalendarpanel.h>
Detailed Description
Provides a widget for calendar input.
Definition at line 46 of file kptcalendarpanel.h.
Signals | |
void | dateChanged (QDate) |
void | dateSelected (QDate) |
void | dateEntered (QDate) |
void | tableClicked () |
void | weekSelected (int week, int year) |
void | weekdaySelected (int day) |
void | selectionCleared () |
Public Member Functions | |
CalendarPanel (QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0, WFlags f=0) | |
CalendarPanel (QWidget *parent, const char *name) | |
virtual | ~CalendarPanel () |
QSize | sizeHint () const |
QSize | minimumSizeHint () const |
bool | setDate (const QDate &) |
const QDate & | getDate () const |
const QDate & | date () const |
void | setEnabled (bool) |
void | setFontSize (int) |
int | fontSize () const |
void | setCloseButton (bool enable) |
bool | hasCloseButton () const |
void | setCalendar (Calendar *cal) |
DateMap | selectedDates () |
IntMap | selectedWeekdays () |
WeekMap | selectedWeeks () |
DateMap | markedDates () |
IntMap | markedWeekdays () |
WeekMap | markedWeeks () |
void | clear () |
void | markSelected (int state) |
Protected Slots | |
void | dateChangedSlot (QDate) |
void | tableClickedSlot () |
void | monthForwardClicked () |
void | monthBackwardClicked () |
void | yearForwardClicked () |
void | yearBackwardClicked () |
void | selectWeekClicked () |
void | selectMonthClicked () |
void | selectYearClicked () |
void | lineEnterPressed () |
void | slotWeekdaySelected (int day) |
void | slotWeekSelected (int week, int year) |
void | slotSelectionCleared () |
Protected Member Functions | |
virtual bool | eventFilter (QObject *o, QEvent *e) |
virtual void | resizeEvent (QResizeEvent *) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
QToolButton * | yearForward |
QToolButton * | yearBackward |
QToolButton * | monthForward |
QToolButton * | monthBackward |
QToolButton * | selectMonth |
QToolButton * | selectYear |
QLineEdit * | line |
DateValidator * | val |
DateTable * | table |
QSize | maxMonthRect |
Properties | |
QDate | date [] |
bool | closeButton [] |
Constructor & Destructor Documentation
KPlato::CalendarPanel::CalendarPanel | ( | QWidget * | parent = 0 , |
|
QDate | = QDate::currentDate() , |
|||
const char * | name = 0 , |
|||
WFlags | f = 0 | |||
) |
The usual constructor.
The given date will be displayed initially.
Definition at line 59 of file kptcalendarpanel.cc.
KPlato::CalendarPanel::CalendarPanel | ( | QWidget * | parent, | |
const char * | name | |||
) |
Standard qt widget constructor.
The initial date will be the current date.
Definition at line 65 of file kptcalendarpanel.cc.
KPlato::CalendarPanel::~CalendarPanel | ( | ) | [virtual] |
Member Function Documentation
QSize KPlato::CalendarPanel::sizeHint | ( | ) | const |
The size hint for date pickers.
The size hint recommends the minimum size of the widget so that all elements may be placed without clipping. This sometimes looks ugly, so when using the size hint, try adding 28 to each of the reported numbers of pixels.
Definition at line 412 of file kptcalendarpanel.cc.
bool KPlato::CalendarPanel::setDate | ( | const QDate & | ) |
Sets the date.
- Returns:
false
and does not change anything if the date given is invalid.
Definition at line 239 of file kptcalendarpanel.cc.
const QDate & KPlato::CalendarPanel::getDate | ( | ) | const |
const QDate& KPlato::CalendarPanel::date | ( | ) | const |
- Returns:
- the selected date.
void KPlato::CalendarPanel::setEnabled | ( | bool | ) |
void KPlato::CalendarPanel::setFontSize | ( | int | ) |
int KPlato::CalendarPanel::fontSize | ( | ) | const [inline] |
void KPlato::CalendarPanel::setCloseButton | ( | bool | enable | ) |
By calling this method with enable
= true, CalendarPanel will show a little close-button in the upper button-row.
Clicking the close-button will cause the CalendarPanel's topLevelWidget()'s close() method being called. This is mostly useful for toplevel datepickers without a window manager decoration.
- See also:
- hasCloseButton
Definition at line 483 of file kptcalendarpanel.cc.
bool KPlato::CalendarPanel::hasCloseButton | ( | ) | const |
- Returns:
- true if a CalendarPanel shows a close-button.
- See also:
- setCloseButton
Definition at line 503 of file kptcalendarpanel.cc.
bool KPlato::CalendarPanel::eventFilter | ( | QObject * | o, | |
QEvent * | e | |||
) | [protected, virtual] |
to catch move keyEvents when QLineEdit has keyFocus
Definition at line 128 of file kptcalendarpanel.cc.
void KPlato::CalendarPanel::resizeEvent | ( | QResizeEvent * | ) | [protected, virtual] |
void KPlato::CalendarPanel::dateChanged | ( | QDate | ) | [signal] |
This signal is emitted each time the selected date is changed.
Usually, this does not mean that the date has been entered, since the date also changes, for example, when another month is selected.
- See also:
- dateSelected
void KPlato::CalendarPanel::dateSelected | ( | QDate | ) | [signal] |
This signal is emitted each time a day has been selected by clicking on the table (hitting a day in the current month).
void KPlato::CalendarPanel::dateEntered | ( | QDate | ) | [signal] |
This signal is emitted when enter is pressed and a VALID date has been entered before into the line edit.
Connect to both dateEntered() and dateSelected() to receive all events where the user really enters a date.
void KPlato::CalendarPanel::tableClicked | ( | ) | [signal] |
This signal is emitted when the day has been selected by clicking on it in the table.
void KPlato::CalendarPanel::selectionCleared | ( | ) | [signal] |
All selections have been cleared.
Member Data Documentation
QToolButton* KPlato::CalendarPanel::yearForward [protected] |
QToolButton* KPlato::CalendarPanel::yearBackward [protected] |
QToolButton* KPlato::CalendarPanel::monthForward [protected] |
QToolButton* KPlato::CalendarPanel::monthBackward [protected] |
QToolButton* KPlato::CalendarPanel::selectMonth [protected] |
QToolButton* KPlato::CalendarPanel::selectYear [protected] |
QLineEdit* KPlato::CalendarPanel::line [protected] |
DateValidator* KPlato::CalendarPanel::val [protected] |
DateTable* KPlato::CalendarPanel::table [protected] |
The documentation for this class was generated from the following files: