Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

KDatePicker Class Reference

A date selection widget. More...

#include <kdatepicker.h>

List of all members.

Signals

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

Public Methods

 KDatePicker (QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0)
 KDatePicker (QWidget *parent, QDate, const char *name, WFlags f)
 KDatePicker (QWidget *parent, const char *name)
virtual ~KDatePicker ()
QSize sizeHint () 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

Protected Slots

void selectWeekClicked ()
 
Since:
3.1



Protected Methods

virtual bool eventFilter (QObject *o, QEvent *e)
 to catch move keyEvents when QLineEdit has keyFocus

virtual void resizeEvent (QResizeEvent *)
 the resize event


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:


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.png

KDE Date Widget

Version:
Id:
kdatepicker.h,v 1.30 2002/09/28 15:16:22 tjansen 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.

KDatePicker::KDatePicker QWidget *    parent,
QDate   ,
const char *    name,
WFlags    f
 

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

Since:
3.1

KDatePicker::KDatePicker QWidget *    parent,
const char *    name
 

Standard qt widget constructor. The initial date will be the current date.

Since:
3.1

virtual KDatePicker::~KDatePicker   [virtual]
 

The destructor.


Member Function Documentation

const QDate& KDatePicker::date  
 

Returns:
the selected date.

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

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.

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.

int KDatePicker::fontSize   const [inline]
 

Returns the font size of the widget elements.

Definition at line 123 of file kdatepicker.h.

const QDate& KDatePicker::getDate  
 

Returns the selected date.

Deprecated:

bool KDatePicker::hasCloseButton  
 

Returns:
true if a KDatePicker shows a close-button.
See also:
setCloseButton
Since:
3.1

void KDatePicker::setCloseButton bool    enable
 

By calling this method with enable = true, KDatePicker will show a little close-button in the upper button-row. Clicking the close-button will cause the KDatePicker's topLevelWidget()'s close() method being called. This is mostly useful for toplevel datepickers without a window manager decoration.

See also:
hasCloseButton
Since:
3.1

bool KDatePicker::setDate const QDate &   
 

Sets the date.

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

void KDatePicker::setEnabled bool   
 

Enables or disables the widget.

void KDatePicker::setFontSize int   
 

Sets the font size of the widgets elements.

QSize KDatePicker::sizeHint  
 

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.

void KDatePicker::tableClicked   [signal]
 

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


The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:08 2003 for kdelibs by doxygen1.2.18