libkdepim Library API Documentation

KDateEdit Class Reference

A date editing widget that consists of an editable combo box. More...

#include <kdateedit.h>

Inheritance diagram for KDateEdit:

QComboBox List of all members.

Signals

void dateChanged (QDate)
 This signal is emitted whenever the user modifies the date.

void invalidDateEntered ()
 This signal is emitted whenever the user enters an invalid date.


Public Member Functions

 KDateEdit (QWidget *parent=0, const char *name=0)
bool inputIsValid () const
QDate date () const
void setDate (const QDate &date)
 Sets the date.

QDate defaultDate () const
void setDefaultDate (const QDate &date)
 Sets the default date to use if no valid date has been set or entered.

void setHandleInvalid (bool handleInvalid)
virtual bool validate (const QDate &newDate)
 Called when a new date has been entered, to validate its value.

virtual void popup ()

Protected Slots

void dateSelected (QDate)
void dateEntered (QDate)
void lineEnterPressed ()
void slotTextChanged (const QString &)
virtual void mousePressEvent (QMouseEvent *)

Detailed Description

A date editing widget that consists of an editable combo box.

The combo box contains the date in text form, and clicking the combo box arrow will display a 'popup' style date picker.

This widget also supports advanced features like allowing the user to type in the day name to get the date. The following keywords are supported (in the native language): tomorrow, yesturday, today, monday, tuesday, wednesday, thursday, friday, saturday, sunday.

Author:
Cornelius Schumacher <schumacher@kde.org>

Mike Pilone <mpilone@slac.com>

David Jarvie <software@astrojar.org.uk>

Definition at line 49 of file kdateedit.h.


Member Function Documentation

bool KDateEdit::inputIsValid  )  const
 

Returns:
True if the date in the text edit is valid, false otherwise. This will not modify the display of the date, but only check for validity.

Definition at line 211 of file kdateedit.cpp.

References QDate::isValid().

QDate KDateEdit::date  )  const
 

Returns:
The date entered. This will not modify the display of the date, but only return it.

Definition at line 121 of file kdateedit.cpp.

References QDate::isValid().

void KDateEdit::setDate const QDate date  ) 
 

Sets the date.

Parameters:
date The new date to display. This date must be valid or it will not be displayed.

Definition at line 90 of file kdateedit.cpp.

References QComboBox::changeItem(), and QDate::isValid().

QDate KDateEdit::defaultDate  )  const
 

Returns:
The default date used if no valid date has been set or entered.

Definition at line 130 of file kdateedit.cpp.

void KDateEdit::setDefaultDate const QDate date  ) 
 

Sets the default date to use if no valid date has been set or entered.

If no default date has been set, the current date is used as the default.

Parameters:
date The default date.

Definition at line 135 of file kdateedit.cpp.

void KDateEdit::setHandleInvalid bool  handleInvalid  ) 
 

Parameters:
handleInvalid If true the date edit accepts invalid dates and displays them as the empty ("") string. It also returns an invalid date. If false (default) invalid dates are not accepted and instead the date of today will be returned.

Definition at line 111 of file kdateedit.cpp.

bool KDateEdit::validate const QDate newDate  )  [virtual]
 

Called when a new date has been entered, to validate its value.

Parameters:
newDate The new date which has been entered.
Returns:
True to accept the new date, false to reject the new date. If false is returned, the value reverts to what it was before the new date was entered.

Definition at line 116 of file kdateedit.cpp.

void KDateEdit::dateChanged QDate   )  [signal]
 

This signal is emitted whenever the user modifies the date.

This may not get emitted until the user presses enter in the line edit or focus leaves the widget (i.e. the user confirms their selection).

void KDateEdit::invalidDateEntered  )  [signal]
 

This signal is emitted whenever the user enters an invalid date.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sun Feb 15 11:40:22 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001