Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

KDatePicker Class Reference

A date selection widget. More...

#include </home/clem/local/src/opie/noncore/apps/tinykate/libkate/microkde/kdatepicker.h>

Collaboration diagram for KDatePicker:

Collaboration graph
[legend]
List of all members.

Signals

void dateChanged (QDate)
void dateSelected (QDate)
void dateEntered (QDate)
void tableClicked ()

Public Member Functions

 KDatePicker (QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0)
virtual ~KDatePicker ()
QSize sizeHint () const
bool setDate (const QDate &)
const QDategetDate () const
const QDatedate () const
void setEnabled (bool)
void setFontSize (int)
int fontSize () const

Protected Slots

void dateChangedSlot (QDate)
void tableClickedSlot ()
void monthForwardClicked ()
void monthBackwardClicked ()
void yearForwardClicked ()
void yearBackwardClicked ()
void selectMonthClicked ()
void selectYearClicked ()
void lineEnterPressed ()

Protected Member Functions

void resizeEvent (QResizeEvent *)
 the resize event
virtual void virtual_hook (int id, void *data)

Protected Attributes

QToolButton * yearForward
 the year forward button
QToolButton * yearBackward
 the year backward button
QToolButton * monthForward
 the month forward button
QToolButton * monthBackward
 the month backward button
QToolButton * selectMonth
 the button for selecting the month directly
QToolButton * selectYear
 the button for selecting the year directly
QLineEdit * line
 the line edit to enter the date directly
KDateValidatorval
 the validator for the line edit:
KDateTabletable
 the date table
QSize maxMonthRect
 the widest month string in pixels:

Private Attributes

int fontsize
 the font size for the widget
KDatePickerPrivate * d

Detailed Description

A date selection widget.

Provides a widget for calendar date input.

Different from the previous versions, it now emits two types of signals, either dateSelected() or dateEntered() (see documentation for both signals).

A line edit has been added in the newer versions to allow the user to select a date directly by entering numbers like 19990101 or 990101.

KDatePicker

Version:
Id
kdatepicker.h,v 1.1 2002/11/10 21:10:14 jowenn Exp
Author:
Tim Gilman, Mirko Boehm

Definition at line 49 of file kdatepicker.h.


Constructor & Destructor Documentation

KDatePicker::KDatePicker QWidget *  parent = 0,
QDate  = QDate::currentDate(),
const char *  name = 0
 

The usual constructor. The given date will be displayed initially.

Definition at line 39 of file kdatepicker.cpp.

References BarIcon(), dateChanged(), dateChangedSlot(), QString::fromLatin1(), line, lineEnterPressed(), monthBackward, monthBackwardClicked(), monthForward, monthForwardClicked(), selectMonth, selectMonthClicked(), selectYear, selectYearClicked(), setDate(), setFontSize(), table, tableClicked(), tableClickedSlot(), val, yearBackward, yearBackwardClicked(), yearForward, and yearForwardClicked().

KDatePicker::~KDatePicker  )  [virtual]
 

The destructor.

Definition at line 71 of file kdatepicker.cpp.


Member Function Documentation

const QDate & KDatePicker::date  )  const
 

Returns:
the selected date.

Definition at line 146 of file kdatepicker.cpp.

References KDateTable::getDate(), and table.

Referenced by selectMonthClicked(), and selectYearClicked().

void KDatePicker::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

Referenced by dateChangedSlot(), and KDatePicker().

void KDatePicker::dateChangedSlot QDate   )  [protected, slot]
 

Definition at line 124 of file kdatepicker.cpp.

References dateChanged(), Opie::Core::endl(), kdDebug(), line, and KGlobal::locale().

Referenced by KDatePicker().

void KDatePicker::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.

Referenced by lineEnterPressed().

void KDatePicker::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). It has the same meaning as dateSelected() in older versions of KDatePicker.

Referenced by tableClickedSlot().

int KDatePicker::fontSize  )  const [inline]
 

Returns the font size of the widget elements.

Definition at line 103 of file kdatepicker.h.

References fontsize.

const QDate & KDatePicker::getDate  )  const
 

Returns the selected date.

Deprecated:

Definition at line 140 of file kdatepicker.cpp.

References KDateTable::getDate(), and table.

void KDatePicker::lineEnterPressed  )  [protected, slot]
 

Definition at line 322 of file kdatepicker.cpp.

References KNotifyClient::beep(), KDateValidator::date(), dateEntered(), Opie::Core::endl(), kdDebug(), line, setDate(), and val.

Referenced by KDatePicker().

void KDatePicker::monthBackwardClicked  )  [protected, slot]
 

Definition at line 190 of file kdatepicker.cpp.

References QDate::day(), QDate::daysInMonth(), KDateTable::getDate(), QDate::month(), setDate(), QDate::setYMD(), table, and QDate::year().

Referenced by KDatePicker().

void KDatePicker::monthForwardClicked  )  [protected, slot]
 

Definition at line 170 of file kdatepicker.cpp.

References QDate::day(), QDate::daysInMonth(), KDateTable::getDate(), QDate::month(), setDate(), QDate::setYMD(), table, and QDate::year().

Referenced by KDatePicker().

void KDatePicker::resizeEvent QResizeEvent *   )  [protected]
 

the resize event

Definition at line 76 of file kdatepicker.cpp.

References height, line, monthBackward, monthForward, selectMonth, selectYear, table, width, Opie::MM::x, yearBackward, and yearForward.

void KDatePicker::selectMonthClicked  )  [protected, slot]
 

Definition at line 246 of file kdatepicker.cpp.

References KNotifyClient::beep(), date(), QDate::day(), QDate::daysInMonth(), KPopupFrame::exec(), fontsize, KDateTable::getDate(), selectMonth, setDate(), KPopupFrame::setMainWidget(), QDate::setYMD(), KDateInternalMonthPicker::sizeHint(), table, and QDate::year().

Referenced by KDatePicker().

void KDatePicker::selectYearClicked  )  [protected, slot]
 

Definition at line 276 of file kdatepicker.cpp.

References KNotifyClient::beep(), date(), QDate::day(), QDate::daysInMonth(), KPopupFrame::exec(), fontsize, KDateTable::getDate(), QDate::month(), selectMonth, selectYear, setDate(), KPopupFrame::setMainWidget(), QDate::setYMD(), and table.

Referenced by KDatePicker().

bool KDatePicker::setDate const QDate  ) 
 

Sets the date.

Returns:
false and does not change anything if the date given is invalid.

Definition at line 152 of file kdatepicker.cpp.

References Opie::Core::endl(), QDate::isValid(), kdDebug(), line, KGlobal::locale(), QDate::month(), selectMonth, selectYear, KDateTable::setDate(), QString::setNum(), table, and QDate::year().

Referenced by KDatePicker(), lineEnterPressed(), monthBackwardClicked(), monthForwardClicked(), selectMonthClicked(), selectYearClicked(), yearBackwardClicked(), and yearForwardClicked().

void KDatePicker::setEnabled bool   ) 
 

Enables or disables the widget.

Definition at line 306 of file kdatepicker.cpp.

References line, monthBackward, monthForward, selectMonth, selectYear, Size, table, yearBackward, and yearForward.

void KDatePicker::setFontSize int   ) 
 

Sets the font size of the widgets elements.

Definition at line 371 of file kdatepicker.cpp.

References fontsize, i, KGlobal::locale(), maxMonthRect, selectMonth, selectYear, KDateTable::setFontSize(), and table.

Referenced by KDatePicker().

QSize KDatePicker::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 338 of file kdatepicker.cpp.

References height, line, maxMonthRect, monthBackward, monthForward, selectMonth, selectYear, KDateTable::sizeHint(), table, yearBackward, and yearForward.

void KDatePicker::tableClicked  )  [signal]
 

This signal is emitted when the day has been selected by clicking on it in the table.

Referenced by KDatePicker(), and tableClickedSlot().

void KDatePicker::tableClickedSlot  )  [protected, slot]
 

Definition at line 132 of file kdatepicker.cpp.

References dateSelected(), Opie::Core::endl(), KDateTable::getDate(), kdDebug(), table, and tableClicked().

Referenced by KDatePicker().

void KDatePicker::virtual_hook int  id,
void *  data
[protected, virtual]
 

Definition at line 403 of file kdatepicker.cpp.

void KDatePicker::yearBackwardClicked  )  [protected, slot]
 

Definition at line 229 of file kdatepicker.cpp.

References QDate::day(), QDate::daysInMonth(), KDateTable::getDate(), QDate::month(), setDate(), QDate::setYMD(), table, and QDate::year().

Referenced by KDatePicker().

void KDatePicker::yearForwardClicked  )  [protected, slot]
 

Definition at line 212 of file kdatepicker.cpp.

References QDate::day(), QDate::daysInMonth(), KDateTable::getDate(), QDate::month(), setDate(), QDate::setYMD(), table, and QDate::year().

Referenced by KDatePicker().


Member Data Documentation

KDatePickerPrivate* KDatePicker::d [private]
 

Definition at line 173 of file kdatepicker.h.

int KDatePicker::fontsize [private]
 

the font size for the widget

Definition at line 168 of file kdatepicker.h.

Referenced by fontSize(), selectMonthClicked(), selectYearClicked(), and setFontSize().

QLineEdit* KDatePicker::line [protected]
 

the line edit to enter the date directly

Definition at line 122 of file kdatepicker.h.

Referenced by dateChangedSlot(), KDatePicker(), lineEnterPressed(), resizeEvent(), setDate(), setEnabled(), and sizeHint().

QSize KDatePicker::maxMonthRect [protected]
 

the widest month string in pixels:

Definition at line 130 of file kdatepicker.h.

Referenced by setFontSize(), and sizeHint().

QToolButton* KDatePicker::monthBackward [protected]
 

the month backward button

Definition at line 116 of file kdatepicker.h.

Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint().

QToolButton* KDatePicker::monthForward [protected]
 

the month forward button

Definition at line 114 of file kdatepicker.h.

Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint().

QToolButton* KDatePicker::selectMonth [protected]
 

the button for selecting the month directly

Definition at line 118 of file kdatepicker.h.

Referenced by KDatePicker(), resizeEvent(), selectMonthClicked(), selectYearClicked(), setDate(), setEnabled(), setFontSize(), and sizeHint().

QToolButton* KDatePicker::selectYear [protected]
 

the button for selecting the year directly

Definition at line 120 of file kdatepicker.h.

Referenced by KDatePicker(), resizeEvent(), selectYearClicked(), setDate(), setEnabled(), setFontSize(), and sizeHint().

KDateTable* KDatePicker::table [protected]
 

the date table

Definition at line 126 of file kdatepicker.h.

Referenced by date(), getDate(), KDatePicker(), monthBackwardClicked(), monthForwardClicked(), resizeEvent(), selectMonthClicked(), selectYearClicked(), setDate(), setEnabled(), setFontSize(), sizeHint(), tableClickedSlot(), yearBackwardClicked(), and yearForwardClicked().

KDateValidator* KDatePicker::val [protected]
 

the validator for the line edit:

Definition at line 124 of file kdatepicker.h.

Referenced by KDatePicker(), and lineEnterPressed().

QToolButton* KDatePicker::yearBackward [protected]
 

the year backward button

Definition at line 112 of file kdatepicker.h.

Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint().

QToolButton* KDatePicker::yearForward [protected]
 

the year forward button

Definition at line 110 of file kdatepicker.h.

Referenced by KDatePicker(), resizeEvent(), setEnabled(), and sizeHint().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:37:22 2005 for OPIE by  doxygen 1.4.2