libkdepim Library API Documentation

KDateEdit Class Reference

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

#include <kdateedit.h>

List of all members.

Signals

void dateChanged (QDate)
void invalidDateEntered ()

Public Member Functions

 KDateEdit (QWidget *parent=0, const char *name=0)
bool inputIsValid () const
QDate date () const
void setDate (const QDate &date)
QDate defaultDate () const
void setDefaultDate (const QDate &date)
void setHandleInvalid (bool handleInvalid)
bool handlesInvalid () const
void setReadOnly (bool readOnly)
bool isReadOnly () const
virtual bool validate (const QDate &newDate)
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 46 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 232 of file kdateedit.cpp.

QDate KDateEdit::date  )  const
 

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

Definition at line 138 of file kdateedit.cpp.

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 91 of file kdateedit.cpp.

QDate KDateEdit::defaultDate  )  const
 

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

Definition at line 147 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 152 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 112 of file kdateedit.cpp.

bool KDateEdit::handlesInvalid  )  const
 

Returns:
True if the widget is accepts invalid dates, false otherwise.

Definition at line 117 of file kdateedit.cpp.

void KDateEdit::setReadOnly bool  readOnly  ) 
 

Sets whether the widget is read-only for the user.

If read-only, the date picker pop-up is inactive, and the displayed date cannot be edited.

Parameters:
readOnly True to set the widget read-only, false to set it read-write.

Definition at line 122 of file kdateedit.cpp.

bool KDateEdit::isReadOnly  )  const
 

Returns:
True if the widget is read-only, false if read-write.

Definition at line 128 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 133 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 libkdepim Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 26 23:23:09 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003