• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

Signals | Public Member Functions | Protected Slots | Protected Member Functions | Properties | List of all members
KDatePicker Class Reference

#include <kdatepicker.h>

Inheritance diagram for KDatePicker:
Inheritance graph
[legend]

Signals

void dateChanged (const QDate &date)
 
void dateEntered (const QDate &date)
 
void dateSelected (const QDate &date)
 
void tableClicked ()
 

Public Member Functions

 KDatePicker (QWidget *parent=0)
 
 KDatePicker (const QDate &dt, QWidget *parent=0)
 
virtual ~KDatePicker ()
 
const KCalendarSystem * calendar () const
 
const QDate & date () const
 
KDateTable * dateTable () const
 
int fontSize () const
 
bool hasCloseButton () const
 
bool setCalendar (KCalendarSystem *calendar=0)
 
bool setCalendar (const QString &calendarType)
 
bool setCalendarSystem (KLocale::CalendarSystem calendarSystem)
 
void setCloseButton (bool enable)
 
bool setDate (const QDate &date)
 
void setEnabled (bool enable)
 
void setFontSize (int)
 
QSize sizeHint () const
 

Protected Slots

void dateChangedSlot (const QDate &date)
 
void lineEnterPressed ()
 
void monthBackwardClicked ()
 
void monthForwardClicked ()
 
void selectMonthClicked ()
 
void selectYearClicked ()
 
void tableClickedSlot ()
 
void todayButtonClicked ()
 
void uncheckYearSelector ()
 
void weekSelected (int)
 
void yearBackwardClicked ()
 
void yearForwardClicked ()
 

Protected Member Functions

virtual bool eventFilter (QObject *o, QEvent *e)
 
virtual void resizeEvent (QResizeEvent *)
 

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
@author Tim Gilman, Mirko Boehm

Definition at line 55 of file kdatepicker.h.

Constructor & Destructor Documentation

KDatePicker::KDatePicker ( QWidget *  parent = 0)
explicit

The constructor.

The current date will be displayed initially.

Definition at line 214 of file kdatepicker.cpp.

KDatePicker::KDatePicker ( const QDate &  dt,
QWidget *  parent = 0 
)
explicit

The constructor.

The given date will be displayed initially.

Definition at line 219 of file kdatepicker.cpp.

KDatePicker::~KDatePicker ( )
virtual

The destructor.

Definition at line 331 of file kdatepicker.cpp.

Member Function Documentation

const KCalendarSystem * KDatePicker::calendar ( ) const

Returns the currently selected calendar system.

Returns
a KCalendarSystem object

Definition at line 396 of file kdatepicker.cpp.

const QDate& KDatePicker::date ( ) const
Returns
the selected date.
void KDatePicker::dateChanged ( const QDate &  date)
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 ( const QDate &  date)
protectedslot

Definition at line 358 of file kdatepicker.cpp.

void KDatePicker::dateEntered ( const QDate &  date)
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 ( const QDate &  date)
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
Returns
the KDateTable widget child of this KDatePicker widget.

Definition at line 554 of file kdatepicker.cpp.

bool KDatePicker::eventFilter ( QObject *  o,
QEvent *  e 
)
protectedvirtual

to catch move keyEvents when QLineEdit has keyFocus

Definition at line 336 of file kdatepicker.cpp.

int KDatePicker::fontSize ( ) const

Returns the font size of the widget elements.

bool KDatePicker::hasCloseButton ( ) const
Returns
true if a KDatePicker shows a close-button.
See also
setCloseButton

Definition at line 668 of file kdatepicker.cpp.

void KDatePicker::lineEnterPressed ( )
protectedslot

Definition at line 559 of file kdatepicker.cpp.

void KDatePicker::monthBackwardClicked ( )
protectedslot

Definition at line 424 of file kdatepicker.cpp.

void KDatePicker::monthForwardClicked ( )
protectedslot

Definition at line 416 of file kdatepicker.cpp.

void KDatePicker::resizeEvent ( QResizeEvent *  e)
protectedvirtual

the resize event

Definition at line 353 of file kdatepicker.cpp.

void KDatePicker::selectMonthClicked ( )
protectedslot

Definition at line 458 of file kdatepicker.cpp.

void KDatePicker::selectYearClicked ( )
protectedslot

Definition at line 495 of file kdatepicker.cpp.

bool KDatePicker::setCalendar ( KCalendarSystem *  calendar = 0)

Changes the calendar system to use.

Can use its own local locale if set.

Parameters
calendarthe calendar system object to use, defaults to global
Returns
true if the calendar system was successfully set, false otherwise

Definition at line 401 of file kdatepicker.cpp.

bool KDatePicker::setCalendar ( const QString &  calendarType)

Changes the calendar system to use.

Will always use global locale.

Parameters
calendarTypethe calendar system type to use
Returns
true if the calendar system was successfully set, false otherwise

Definition at line 406 of file kdatepicker.cpp.

bool KDatePicker::setCalendarSystem ( KLocale::CalendarSystem  calendarSystem)
Since
4.6

Changes the calendar system to use. Will always use global locale.

Parameters
calendarSystemthe calendar system to use
Returns
true if the calendar system was successfully set, false otherwise

Definition at line 411 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

Definition at line 645 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 389 of file kdatepicker.cpp.

void KDatePicker::setEnabled ( bool  enable)

Enables or disables the widget.

Definition at line 538 of file kdatepicker.cpp.

void KDatePicker::setFontSize ( int  s)

Sets the font size of the widgets elements.

Definition at line 583 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 578 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 ( )
protectedslot

Definition at line 378 of file kdatepicker.cpp.

void KDatePicker::todayButtonClicked ( )
protectedslot

Definition at line 572 of file kdatepicker.cpp.

void KDatePicker::uncheckYearSelector ( )
protectedslot

Definition at line 530 of file kdatepicker.cpp.

void KDatePicker::weekSelected ( int  index)
protectedslot

Definition at line 448 of file kdatepicker.cpp.

void KDatePicker::yearBackwardClicked ( )
protectedslot

Definition at line 440 of file kdatepicker.cpp.

void KDatePicker::yearForwardClicked ( )
protectedslot

Definition at line 432 of file kdatepicker.cpp.

Property Documentation

bool KDatePicker::closeButton
readwrite

Definition at line 60 of file kdatepicker.h.

const QDate & KDatePicker::date
readwrite

Definition at line 58 of file kdatepicker.h.

int KDatePicker::fontSize
readwrite

Definition at line 61 of file kdatepicker.h.


The documentation for this class was generated from the following files:
  • kdatepicker.h
  • kdatepicker.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal