• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kdeui

KDatePicker Class Reference

A date selection widget. More...

#include <kdatepicker.h>

Inheritance diagram for KDatePicker:

Inheritance graph
[legend]

List of all members.


Signals

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

Public Member Functions

const QDate & date () const
KDateTable * dateTable () const
int fontSize () const
const QDate & getDate () const KDE_DEPRECATED
bool hasCloseButton () const
 KDatePicker (QWidget *parent, const char *name)
 KDatePicker (QWidget *parent, QDate, const char *name, WFlags f)
 KDatePicker (QWidget *parent=0, QDate=QDate::currentDate(), const char *name=0)
void setCloseButton (bool enable)
bool setDate (const QDate &)
void setEnabled (bool)
void setFontSize (int)
QSize sizeHint () const
virtual ~KDatePicker ()

Protected Slots

void dateChangedSlot (QDate)
void lineEnterPressed ()
void monthBackwardClicked ()
void monthForwardClicked ()
void selectMonthClicked ()
void selectWeekClicked ()
void selectYearClicked ()
void tableClickedSlot ()
void todayButtonClicked ()
void weekSelected (int)
void yearBackwardClicked ()
void yearForwardClicked ()

Protected Member Functions

virtual bool eventFilter (QObject *o, QEvent *e)
virtual void resizeEvent (QResizeEvent *)
virtual void virtual_hook (int id, void *data)

Protected Attributes

QLineEdit * line
QSize maxMonthRect
QToolButton * monthBackward
QToolButton * monthForward
QToolButton * selectMonth
QToolButton * selectYear
KDateTable * table
KDateValidator * val
QToolButton * yearBackward
QToolButton * yearForward

Properties

bool closeButton
QDate date
int fontSize

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 669008 2007-05-28 10:32:33Z mueller
Author:
Tim Gilman, Mirko Boehm

Definition at line 51 of file kdatepicker.h.


Constructor & Destructor Documentation

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

The usual constructor.

The given date will be displayed initially.

Definition at line 99 of file kdatepicker.cpp.

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

The usual constructor.

The given date will be displayed initially.

Since:
3.1

Definition at line 105 of file kdatepicker.cpp.

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

Standard qt widget constructor.

The initial date will be the current date.

Since:
3.1

Definition at line 111 of file kdatepicker.cpp.

KDatePicker::~KDatePicker (  )  [virtual]

The destructor.

Definition at line 215 of file kdatepicker.cpp.


Member Function Documentation

const QDate& KDatePicker::date (  )  const

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::dateChangedSlot ( QDate  date  )  [protected, slot]

Definition at line 246 of file kdatepicker.cpp.

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.

KDateTable* KDatePicker::dateTable (  )  const [inline]

Returns:
the KDateTable widget child of this KDatePicker widget.
Since:
3.2

Definition at line 124 of file kdatepicker.h.

bool KDatePicker::eventFilter ( QObject *  o,
QEvent *  e 
) [protected, virtual]

to catch move keyEvents when QLineEdit has keyFocus

Definition at line 221 of file kdatepicker.cpp.

int KDatePicker::fontSize (  )  const [inline]

Returns the font size of the widget elements.

Definition at line 133 of file kdatepicker.h.

const QDate & KDatePicker::getDate (  )  const

Returns the selected date.

Deprecated:

Definition at line 274 of file kdatepicker.cpp.

bool KDatePicker::hasCloseButton (  )  const

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

Definition at line 542 of file kdatepicker.cpp.

void KDatePicker::lineEnterPressed (  )  [protected, slot]

Since:
3.1

Definition at line 448 of file kdatepicker.cpp.

void KDatePicker::monthBackwardClicked (  )  [protected, slot]

Definition at line 310 of file kdatepicker.cpp.

void KDatePicker::monthForwardClicked (  )  [protected, slot]

Definition at line 301 of file kdatepicker.cpp.

void KDatePicker::resizeEvent ( QResizeEvent *  e  )  [protected, virtual]

the resize event

Reimplemented from QFrame.

Definition at line 240 of file kdatepicker.cpp.

void KDatePicker::selectMonthClicked (  )  [protected, slot]

Since:
3.1

Definition at line 355 of file kdatepicker.cpp.

void KDatePicker::selectWeekClicked (  )  [protected, slot]

Since:
3.1
Deprecated:
in 3.2

Definition at line 336 of file kdatepicker.cpp.

void KDatePicker::selectYearClicked (  )  [protected, slot]

Since:
3.1

Definition at line 380 of file kdatepicker.cpp.

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

Definition at line 519 of file kdatepicker.cpp.

bool KDatePicker::setDate ( const QDate &  date  ) 

Sets the date.

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

Definition at line 286 of file kdatepicker.cpp.

void KDatePicker::setEnabled ( bool  enable  ) 

Enables or disables the widget.

Definition at line 432 of file kdatepicker.cpp.

void KDatePicker::setFontSize ( int  s  ) 

Sets the font size of the widgets elements.

Definition at line 476 of file kdatepicker.cpp.

QSize KDatePicker::sizeHint ( void   )  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 470 of file kdatepicker.cpp.

void KDatePicker::tableClicked (  )  [signal]

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

void KDatePicker::tableClickedSlot (  )  [protected, slot]

Definition at line 266 of file kdatepicker.cpp.

void KDatePicker::todayButtonClicked (  )  [protected, slot]

Since:
3.2

Definition at line 464 of file kdatepicker.cpp.

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

Definition at line 547 of file kdatepicker.cpp.

void KDatePicker::weekSelected ( int  week  )  [protected, slot]

Since:
3.2

Definition at line 339 of file kdatepicker.cpp.

void KDatePicker::yearBackwardClicked (  )  [protected, slot]

Definition at line 328 of file kdatepicker.cpp.

void KDatePicker::yearForwardClicked (  )  [protected, slot]

Definition at line 319 of file kdatepicker.cpp.


Member Data Documentation

QLineEdit* KDatePicker::line [protected]

the line edit to enter the date directly

Definition at line 172 of file kdatepicker.h.

QSize KDatePicker::maxMonthRect [protected]

the size calculated during resize events

the widest month string in pixels:

Definition at line 180 of file kdatepicker.h.

QToolButton* KDatePicker::monthBackward [protected]

the month backward button

Definition at line 166 of file kdatepicker.h.

QToolButton* KDatePicker::monthForward [protected]

the month forward button

Definition at line 164 of file kdatepicker.h.

QToolButton* KDatePicker::selectMonth [protected]

the button for selecting the month directly

Definition at line 168 of file kdatepicker.h.

QToolButton* KDatePicker::selectYear [protected]

the button for selecting the year directly

Definition at line 170 of file kdatepicker.h.

KDateTable* KDatePicker::table [protected]

the date table

Definition at line 176 of file kdatepicker.h.

KDateValidator* KDatePicker::val [protected]

the validator for the line edit:

Definition at line 174 of file kdatepicker.h.

QToolButton* KDatePicker::yearBackward [protected]

the year backward button

Definition at line 162 of file kdatepicker.h.

QToolButton* KDatePicker::yearForward [protected]

the year forward button

Definition at line 160 of file kdatepicker.h.


Property Documentation

bool KDatePicker::closeButton [read, write]

Definition at line 55 of file kdatepicker.h.

const QDate & KDatePicker::date [read, write]

Definition at line 54 of file kdatepicker.h.

int KDatePicker::fontSize [read, write]

Definition at line 56 of file kdatepicker.h.


The documentation for this class was generated from the following files:
  • kdatepicker.h
  • kdatepicker.cpp

kdeui

Skip menu "kdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal