kplato

KPlato::CalendarPanel Class Reference

#include <kptcalendarpanel.h>

List of all members.


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
DateValidatorval
DateTabletable
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]

The destructor.

Definition at line 122 of file kptcalendarpanel.cc.


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

Returns the selected date.

Deprecated:

Definition at line 227 of file kptcalendarpanel.cc.

const QDate& KPlato::CalendarPanel::date (  )  const

Returns:
the selected date.

void KPlato::CalendarPanel::setEnabled ( bool   ) 

Enables or disables the widget.

Definition at line 379 of file kptcalendarpanel.cc.

void KPlato::CalendarPanel::setFontSize ( int   ) 

Sets the font size of the widgets elements.

Definition at line 450 of file kptcalendarpanel.cc.

int KPlato::CalendarPanel::fontSize (  )  const [inline]

Returns the font size of the widget elements.

Definition at line 109 of file kptcalendarpanel.h.

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]

the resize event

Definition at line 147 of file kptcalendarpanel.cc.

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]

the year forward button

Definition at line 148 of file kptcalendarpanel.h.

QToolButton* KPlato::CalendarPanel::yearBackward [protected]

the year backward button

Definition at line 150 of file kptcalendarpanel.h.

QToolButton* KPlato::CalendarPanel::monthForward [protected]

the month forward button

Definition at line 152 of file kptcalendarpanel.h.

QToolButton* KPlato::CalendarPanel::monthBackward [protected]

the month backward button

Definition at line 154 of file kptcalendarpanel.h.

QToolButton* KPlato::CalendarPanel::selectMonth [protected]

the button for selecting the month directly

Definition at line 156 of file kptcalendarpanel.h.

QToolButton* KPlato::CalendarPanel::selectYear [protected]

the button for selecting the year directly

Definition at line 158 of file kptcalendarpanel.h.

QLineEdit* KPlato::CalendarPanel::line [protected]

the line edit to enter the date directly

Definition at line 160 of file kptcalendarpanel.h.

the validator for the line edit:

Definition at line 162 of file kptcalendarpanel.h.

the date table

Definition at line 164 of file kptcalendarpanel.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys