KDE 5.0 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

KDateComboBox Class Reference

from PyKDE5.kwidgetsaddons import *

Inherits: QComboBox → QWidget → QObject

Detailed Description


Enumerations

Option { EditDate, SelectDate, DatePicker, DateKeywords, WarnOnInvalid }

Signals

 dateChanged (QDate date)
 dateEdited (QDate date)
 dateEntered (QDate date)

Methods

 __init__ (self, QWidget parent=0)
 assignDate (self, QDate date)
QDate date (self)
{QDate:QString} dateMap (self)
QLocale::FormatType displayFormat (self)
bool eventFilter (self, QObject object, QEvent event)
 focusInEvent (self, QFocusEvent event)
 focusOutEvent (self, QFocusEvent event)
 hidePopup (self)
bool isNull (self)
bool isValid (self)
 keyPressEvent (self, QKeyEvent event)
QDate maximumDate (self)
QDate minimumDate (self)
 mousePressEvent (self, QMouseEvent event)
KDateComboBox::Options options (self)
 resetDateRange (self)
 resetMaximumDate (self)
 resetMinimumDate (self)
 resizeEvent (self, QResizeEvent event)
 setDate (self, QDate date)
 setDateMap (self, {QDate:QString} dateMap)
 setDateRange (self, QDate minDate, QDate maxDate, QString minWarnMsg=QString(), QString maxWarnMsg=QString())
 setDisplayFormat (self, QLocale::FormatType format)
 setMaximumDate (self, QDate maxDate, QString maxWarnMsg=QString())
 setMinimumDate (self, QDate minTime, QString minWarnMsg=QString())
 setOptions (self, KDateComboBox::Options options)
 showPopup (self)
 wheelEvent (self, QWheelEvent event)

Signal Documentation

dateChanged ( QDate  date
)

Signal if the date has been changed either manually by the user or programatically.

The returned date may be invalid.

Parameters:
date  the new date

Signal syntax:
QObject.connect(source, SIGNAL("dateChanged(const QDate&)"), target_slot)
dateEdited ( QDate  date
)

Signal if the date is being manually edited by the user.

The returned date may be invalid.

Parameters:
date  the new date

Signal syntax:
QObject.connect(source, SIGNAL("dateEdited(const QDate&)"), target_slot)
dateEntered ( QDate  date
)

Signal if the date has been manually entered or selected by the user.

The returned date may be invalid.

Parameters:
date  the new date

Signal syntax:
QObject.connect(source, SIGNAL("dateEntered(const QDate&)"), target_slot)

Method Documentation

__init__ (  self,
QWidget  parent=0
)

Create a new KDateComboBox widget

By default the EditDate, SelectDate, DatePicker and DateKeywords options are enabled, the ShortDate format is used and the date is set to the current date.

assignDate (  self,
QDate  date
)

Assign the date for the widget.

Virtual to allow sub-classes to apply extra validation rules.

Parameters:
date  the new date

QDate date (   self )

Return the currently selected date

Returns:
the currently selected date

{QDate:QString} dateMap (   self )

Return the map of dates listed in the drop-down and their displayed string forms.

See also:
setDateMap()
Returns:
the select date map

QLocale::FormatType displayFormat (   self )

Return the currently set date display format

By default this is the Short Format

Returns:
the currently set date format

bool eventFilter (  self,
QObject  object,
QEvent  event
)
focusInEvent (  self,
QFocusEvent  event
)
focusOutEvent (  self,
QFocusEvent  event
)
hidePopup (   self )
bool isNull (   self )

Return if the current user input is null

See also:
isValid()
Returns:
if the current user input is null

bool isValid (   self )

Return if the current user input is valid

If the user input is null then it is not valid

See also:
isNull()
Returns:
if the current user input is valid

keyPressEvent (  self,
QKeyEvent  event
)
QDate maximumDate (   self )

Return the current maximum date

Returns:
the current maximum date

QDate minimumDate (   self )

Return the current minimum date

Returns:
the current minimum date

mousePressEvent (  self,
QMouseEvent  event
)
KDateComboBox::Options options (   self )

Return the currently set widget options

Returns:
the currently set widget options

resetDateRange (   self )

Reset the minimum and maximum date to the default values.

See also:
setDateRange()

resetMaximumDate (   self )

Reset the maximum date to the default

resetMinimumDate (   self )

Reset the minimum date to the default

resizeEvent (  self,
QResizeEvent  event
)
setDate (  self,
QDate  date
)

Set the currently selected date

You can set an invalid date or a date outside the valid range, validity checking is only done via isValid().

Parameters:
date  the new date

setDateMap (  self,
{QDate:QString}  dateMap
)

Set the list of dates able to be selected from the drop-down and the string form to display for those dates, e.g. "2010-01-01" and "Yesterday".

Any invalid or duplicate dates will be used, the list will NOT be sorted, and the minimum and maximum date will not be affected.

The dateMap is keyed by the date to be listed and the value is the string to be displayed. If you want the date to be displayed in the default date format then the string should be null. If you want a separator to be displayed then set the string to "separator".

See also:
dateMap()

Parameters:
dateMap  the map of dates able to be selected

setDateRange (  self,
QDate  minDate,
QDate  maxDate,
QString  minWarnMsg=QString(),
QString  maxWarnMsg=QString()
)

Set the valid date range to be applied by isValid().

Both dates must be valid and the minimum date must be less than or equal to the maximum date, otherwise the date range will not be set.

Parameters:
minDate  the minimum date
maxDate  the maximum date
minWarnMsg  the minimum warning message
maxWarnMsg  the maximum warning message

setDisplayFormat (  self,
QLocale::FormatType  format
)

Sets the date format to display.

By default is the Short Format.

Parameters:
format  the date format to use

setMaximumDate (  self,
QDate  maxDate,
QString  maxWarnMsg=QString()
)

Set the maximum allowed date.

If the date is invalid, or less than current minimum, then the maximum will not be set.

See also:
minimumDate()
See also:
maximumDate()
See also:
setMaximumDate()
See also:
setDateRange()

Parameters:
maxDate  the maximum date
maxWarnMsg  the maximum warning message

setMinimumDate (  self,
QDate  minTime,
QString  minWarnMsg=QString()
)

Set the minimum allowed date.

If the date is invalid, or greater than current maximum, then the minimum will not be set.

See also:
minimumDate()
See also:
maximumDate()
See also:
setMaximumDate()
See also:
setDateRange()

Parameters:
minDate  the minimum date
minWarnMsg  the minimum warning message

setOptions (  self,
KDateComboBox::Options  options
)

Set the new widget options

Parameters:
options  the new widget options

showPopup (   self )
wheelEvent (  self,
QWheelEvent  event
)

Enumeration Documentation

Option

Options provided by the widget

See also:
options()
See also:
setOptions()

Enumerator:
EditTime = 0x0001
SelectTime = 0x0002
ForceTime = 0x0004
WarnOnInvalid = 0x0008

  • Full Index

Modules

  • karchive
  • kcoreaddons
  • kguiaddons
  • kitemmodels
  • kitemviews
  • kplotting
  • kwidgetsaddons
  • solid
  • sonnet
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal