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

KDateTimeEdit Class Reference

from PyKDE5.kwidgetsaddons import *

Inherits: QWidget → QObject

Detailed Description


Enumerations

Option { ShowCalendar, ShowDate, ShowTime, ShowTimeZone, EditDate, EditTime, SelectCalendar, SelectDate, SelectTime, SelectTimeZone, DatePicker, DateKeywords, ForceTime, WarnOnInvalid }

Signals

 calendarChanged (QLocale calendarLocale)
 calendarEntered (QLocale calendarLocale)
 dateChanged (QDate date)
 dateEdited (QDate date)
 dateEntered (QDate date)
 dateTimeChanged (QDateTime dateTime)
 dateTimeEdited (QDateTime dateTime)
 dateTimeEntered (QDateTime dateTime)
 timeChanged (QTime time)
 timeEdited (QTime time)
 timeEntered (QTime time)
 timeZoneChanged (QTimeZone zone)
 timeZoneEntered (QTimeZone zone)

Methods

 __init__ (self, QWidget parent=0)
 assignDate (self, QDate date)
 assignDateTime (self, QDateTime dateTime)
 assignTime (self, QTime time)
 assignTimeZone (self, QTimeZone zone)
[QLocale] calendarLocalesList (self)
QDate date (self)
QLocale::FormatType dateDisplayFormat (self)
{QDate:QString} dateMap (self)
QDateTime dateTime (self)
bool eventFilter (self, QObject object, QEvent event)
 focusInEvent (self, QFocusEvent event)
 focusOutEvent (self, QFocusEvent event)
bool isNull (self)
bool isNullDate (self)
bool isNullTime (self)
bool isValid (self)
bool isValidDate (self)
bool isValidTime (self)
QDateTime maximumDateTime (self)
QDateTime minimumDateTime (self)
KDateTimeEdit::Options options (self)
 resetDateTimeRange (self)
 resetMaximumDateTime (self)
 resetMinimumDateTime (self)
 resizeEvent (self, QResizeEvent event)
 setCalendarLocalesList (self, [QLocale] calendarLocales)
 setDate (self, QDate date)
 setDateDisplayFormat (self, QLocale::FormatType format)
 setDateMap (self, {QDate:QString} dateMap)
 setDateTime (self, QDateTime dateTime)
 setDateTimeRange (self, QDateTime minDateTime, QDateTime maxDateTime, QString minWarnMsg=QString(), QString maxWarnMsg=QString())
 setMaximumDateTime (self, QDateTime maxDateTime, QString maxWarnMsg=QString())
 setMinimumDateTime (self, QDateTime minDateTime, QString minWarnMsg=QString())
 setOptions (self, KDateTimeEdit::Options options)
 setTime (self, QTime time)
 setTimeDisplayFormat (self, QLocale::FormatType formatOptions)
 setTimeList (self, [QTime] timeList, QString minWarnMsg=QString(), QString maxWarnMsg=QString())
 setTimeListInterval (self, int minutes)
 setTimeZone (self, QTimeZone zone)
 setTimeZones (self, [QTimeZone] zones)
QTime time (self)
QLocale::FormatType timeDisplayFormat (self)
[QTime] timeList (self)
int timeListInterval (self)
QTimeZone timeZone (self)
[QTimeZone] timeZones (self)

Signal Documentation

calendarChanged ( QLocale  calendarLocale
)

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

Parameters:
calendarLocale  the new calendar locale

Signal syntax:
QObject.connect(source, SIGNAL("calendarChanged(const QLocale&)"), target_slot)
calendarEntered ( QLocale  calendarLocale
)

Signal if the Calendar Locale has been manually entered by the user.

Parameters:
calendarLocale  the new calendar locale

Signal syntax:
QObject.connect(source, SIGNAL("calendarEntered(const QLocale&)"), target_slot)
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 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)
dateTimeChanged ( QDateTime  dateTime
)

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

The returned date and time may be invalid.

Parameters:
dateTime  the new date, time and time zone

Signal syntax:
QObject.connect(source, SIGNAL("dateTimeChanged(const QDateTime&)"), target_slot)
dateTimeEdited ( QDateTime  dateTime
)

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

The returned date and time may be invalid.

Parameters:
dateTime  the new date, time and time zone

Signal syntax:
QObject.connect(source, SIGNAL("dateTimeEdited(const QDateTime&)"), target_slot)
dateTimeEntered ( QDateTime  dateTime
)

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

The returned date and time may be invalid.

Parameters:
dateTime  the new date, time and time zone

Signal syntax:
QObject.connect(source, SIGNAL("dateTimeEntered(const QDateTime&)"), target_slot)
timeChanged ( QTime  time
)

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

The returned time may be invalid.

Parameters:
time  the new time

Signal syntax:
QObject.connect(source, SIGNAL("timeChanged(const QTime&)"), target_slot)
timeEdited ( QTime  time
)

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

The returned time may be invalid.

Parameters:
time  the new time

Signal syntax:
QObject.connect(source, SIGNAL("timeEdited(const QTime&)"), target_slot)
timeEntered ( QTime  time
)

Signal if the time has been manually entered by the user.

The returned time may be invalid.

Parameters:
time  the new time

Signal syntax:
QObject.connect(source, SIGNAL("timeEntered(const QTime&)"), target_slot)
timeZoneChanged ( QTimeZone  zone
)

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

Parameters:
timeZone  the new time zone

Signal syntax:
QObject.connect(source, SIGNAL("timeZoneChanged(const QTimeZone&)"), target_slot)
timeZoneEntered ( QTimeZone  zone
)

Signal if the time zone has been changed manually by the user.

Parameters:
timeZone  the new time zone

Signal syntax:
QObject.connect(source, SIGNAL("timeZoneEntered(const QTimeZone&)"), target_slot)

Method Documentation

__init__ (  self,
QWidget  parent=0
)

Create a new KDateTimeEdit widget

assignDate (  self,
QDate  date
)

Assign the date for the widget.

Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.

Parameters:
date  the new date

assignDateTime (  self,
QDateTime  dateTime
)

Assign the date, time and time zone for the widget.

Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.

Parameters:
datetime  the new date and time

assignTime (  self,
QTime  time
)

Assign the time for the widget.

Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.

Parameters:
time  the new time

assignTimeZone (  self,
QTimeZone  zone
)

Assign the time zone for the widget.

Virtual to allow sub-classes to apply extra validation rules, but reimplementations must call the parent method at the end.

Parameters:
zone  the new time zone

[QLocale] calendarLocalesList (   self )

Returns the list of Calendar Systems displayed.

Parameters:
calendars  the list of calendar systems to display

QDate date (   self )

Return the currently selected date

Returns:
the currently selected date

QLocale::FormatType dateDisplayFormat (   self )

Return the currently set date display format

By default this is the Short Format

Returns:
the currently set date format

{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

QDateTime dateTime (   self )

Return the currently selected date, time and time zone

Returns:
the currently selected date, time and time zone

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

Return if the current user input is null

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

bool isNullDate (   self )

Return if the current user input date is null

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

bool isNullTime (   self )

Return if the current user input time is null

See also:
isValidTime()
Returns:
if the current user input time 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

bool isValidDate (   self )

Return if the current user input date is valid

If the user input date is null then it is not valid

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

bool isValidTime (   self )

Return if the current user input time is valid

If the user input time is null then it is not valid

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

QDateTime maximumDateTime (   self )

Return the current maximum date and time

Returns:
the current maximum date and time

QDateTime minimumDateTime (   self )

Return the current minimum date and time

Returns:
the current minimum date and time

KDateTimeEdit::Options options (   self )

Return the currently set widget options

Returns:
the currently set widget options

resetDateTimeRange (   self )

Reset the minimum and maximum date and time to the default

resetMaximumDateTime (   self )

Reset the minimum date and time to the default

resetMinimumDateTime (   self )

Reset the minimum date and time to the default

resizeEvent (  self,
QResizeEvent  event
)
setCalendarLocalesList (  self,
[QLocale]  calendarLocales
)

Set the list of Calendar Locales to display.

Parameters:
calendarLocales  the list of calendar locales to display

setDate (  self,
QDate  date
)

Set the currently selected date

Parameters:
date  the new date

setDateDisplayFormat (  self,
QLocale::FormatType  format
)

Sets the date format to display.

By default is the Short Format.

Parameters:
format  the date format to use

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

setDateTime (  self,
QDateTime  dateTime
)

Set the currently selected date, time and time zone

Parameters:
dateTime  the new date, time and time zone

setDateTimeRange (  self,
QDateTime  minDateTime,
QDateTime  maxDateTime,
QString  minWarnMsg=QString(),
QString  maxWarnMsg=QString()
)

Set the minimum and maximum date and time range

To enable range checking provide two valid dates. To disable range checking provide two invalid dates, or call clearDateRange;

Parameters:
minDateTime  the minimum date and time
maxDateTime  the maximum date and time
minWarnMsg  the minimum warning message
maxWarnMsg  the maximum warning message

setMaximumDateTime (  self,
QDateTime  maxDateTime,
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:
setMinimumDateTime()
See also:
setDateRange()

Parameters:
maxDate  the maximum date
maxWarnMsg  the maximum warning message

setMinimumDateTime (  self,
QDateTime  minDateTime,
QString  minWarnMsg=QString()
)

Set the minimum allowed date.

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

See also:
setMaximumDateTime()
See also:
setDateRange()

Parameters:
maxDate  the minimum date
maxWarnMsg  the minimum warning message

setOptions (  self,
KDateTimeEdit::Options  options
)

Set the new widget options

Parameters:
options  the new widget options

setTime (  self,
QTime  time
)

Set the currently selected time

Parameters:
time  the new time

setTimeDisplayFormat (  self,
QLocale::FormatType  formatOptions
)

Sets the time format to display.

By default is the Short Format.

Parameters:
format  the time format to use

setTimeList (  self,
[QTime]  timeList,
QString  minWarnMsg=QString(),
QString  maxWarnMsg=QString()
)

Set the list of times able to be selected from the drop-down.

Setting the time list will override any time interval previously set via setTimeListInterval().

Any invalid or duplicate times will be ignored, and the list will be sorted.

The minimum and maximum time will automatically be set to the earliest and latest value in the list.

See also:
timeList()

Parameters:
timeList  the list of times able to be selected
minWarnMsg  the minimum warning message
maxWarnMsg  the maximum warning message

setTimeListInterval (  self,
int  minutes
)

Set the interval between times able to be selected from the drop-down.

The combo drop-down will be populated with times every

Parameters:
minutes  apart, starting from the minimumTime() and ending at maximumTime().

If the ForceInterval option is set then any time manually typed into the combo line edit will be forced to the nearest interval.

This interval must be an exact divisor of the valid time range hours. For example with the default 24 hour range interval must divide 1440 minutes exactly, meaning 1, 6 and 90 are valid but 7, 31 and 91 are not.

Setting the time list interval will override any time list previously set via setTimeList().

See also:
timeListInterval()

Parameters:
minutes  the time list interval to display

setTimeZone (  self,
QTimeZone  zone
)

Set the current time zone

Parameters:
zone  the new zone

setTimeZones (  self,
[QTimeZone]  zones
)

Set the time zones able to be selected

Parameters:
zones  the time zones to display

QTime time (   self )

Return the currently selected time

Returns:
the currently selected time

QLocale::FormatType timeDisplayFormat (   self )

Return the currently set time format

By default this is the Short Format

Returns:
the currently set time format

[QTime] timeList (   self )

Return the list of times able to be selected in the drop-down.

See also:
setTimeList()
See also:
timeListInterval()
See also:
setTimeListInterval()
Returns:
the select time list

int timeListInterval (   self )

Return the time list interval able to be selected

Returns:
the select time intervals in minutes

QTimeZone timeZone (   self )

Return the currently selected time zone

Returns:
the currently selected time zone

[QTimeZone] timeZones (   self )

Return the list of time zones able to be selected

Parameters:
zones  the time zones to display


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