KDE 4.9 PyKDE API Reference

- KDE's Python API

# KTimeComboBox Class Reference

`from PyKDE4.kdeui import *`

Inherits: KComboBox → QComboBox → QWidget → QObject

## Detailed Description

## Enumerations

Option | { EditTime, SelectTime, ForceTime, WarnOnInvalid }

## Signals

| timeChanged (QTime time)
| timeEdited (QTime time)
| timeEntered (QTime time)

## Methods

| __init__ (self, QWidget parent=0)
| assignTime (self, QTime time)
KLocale.TimeFormatOptions | 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)
QTime | maximumTime (self)
QTime | minimumTime (self)
| mousePressEvent (self, QMouseEvent event)
KTimeComboBox.Options | options (self)
| resetMaximumTime (self)
| resetMinimumTime (self)
| resetTimeRange (self)
| resizeEvent (self, QResizeEvent event)
| setDisplayFormat (self, KLocale.TimeFormatOptions formatOptions)
| setMaximumTime (self, QTime maxTime, QString maxWarnMsg=QString())
| setMinimumTime (self, QTime minTime, QString minWarnMsg=QString())
| setOptions (self, KTimeComboBox.Options options)
| setTime (self, QTime time)
| setTimeList (self, [QTime] timeList, QString minWarnMsg=QString(), QString maxWarnMsg=QString())
| setTimeListInterval (self, int minutes)
| setTimeRange (self, QTime minTime, QTime maxTime, QString minWarnMsg=QString(), QString maxWarnMsg=QString())
| showPopup (self)
QTime | time (self)
[QTime] | timeList (self)
int | timeListInterval (self)
| wheelEvent (self, QWheelEvent event)

## Signal Documentation

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 or selected 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)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Create a new KTimeComboBox widget

assignTime | ( | self, |
|  | QTime | time
| ) |  |  |

Assign the time for the widget.

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

Parameters:

  | time | the new time

KLocale.TimeFormatOptions displayFormat | ( |  | self ) |

Return the currently set time format

By default this is the Short Time

Returns:
  the currently set time 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
| ) |  |  |

QTime maximumTime | ( |  | self ) |

Return the current maximum time

Returns:
  the current maximum time

QTime minimumTime | ( |  | self ) |

Return the current minimum time

Returns:
  the current minimum time

mousePressEvent | ( | self, |
|  | QMouseEvent | event
| ) |  |  |

KTimeComboBox.Options options | ( |  | self ) |

Return the currently set widget options

Returns:
  the currently set widget options

resetMaximumTime | ( |  | self ) |

Reset the maximum time to the default of 23:59:59.999

resetMinimumTime | ( |  | self ) |

Reset the minimum time to the default of 00:00:00.000

resetTimeRange | ( |  | self ) |

Reset the minimum and maximum time to the default values.

resizeEvent | ( | self, |
|  | QResizeEvent | event
| ) |  |  |

setDisplayFormat | ( | self, |
|  | KLocale.TimeFormatOptions | formatOptions
| ) |  |  |

Sets the time format to display.

By default is the Short Time format.

Parameters:

  | format | the time format to use

setMaximumTime | ( | self, |
|  | QTime | maxTime,
|  | QString | maxWarnMsg=QString()
| ) |  |  |

Set the maximum allowed time.

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

See also:
  minimumTime()

See also:
  maximumTime()

See also:
  setMaximumTime()

See also:
  setTimeRange()

Parameters:

  | maxTime | the maximum time
  | maxWarnMsg | the maximum warning message

setMinimumTime | ( | self, |
|  | QTime | minTime,
|  | QString | minWarnMsg=QString()
| ) |  |  |

Set the minimum allowed time.

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

See also:
  minimumTime()

See also:
  maximumTime()

See also:
  setMaximumTime()

See also:
  setTimeRange()

Parameters:

  | minTime | the minimum time
  | minWarnMsg | the minimum warning message

setOptions | ( | self, |
|  | KTimeComboBox.Options | options
| ) |  |  |

Set the new widget options

Parameters:

  | options | the new widget options

setTime | ( | self, |
|  | QTime | time
| ) |  |  |

Set the currently selected time

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

Parameters:

  | time | the new time

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

setTimeRange | ( | self, |
|  | QTime | minTime,
|  | QTime | maxTime,
|  | QString | minWarnMsg=QString(),
|  | QString | maxWarnMsg=QString()
| ) |  |  |

Set the minimum and maximum time range.

If either time is invalid, or min > max then the range will not be set.

Parameters:

  | minTime | the minimum time
  | maxTime | the maximum time
  | minWarnMsg | the minimum warning message
  | maxWarnMsg | the maximum warning message

showPopup | ( |  | self ) |

QTime time | ( |  | self ) |

Return the currently selected time

Returns:
  the currently selected time

[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 interval between select time list entries if set by setTimeListInterval().

Returns -1 if not set.

See also:
  setTimeListInterval()

Returns:
  the select time list interval in minutes

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 |