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

KDEUI

Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties
KTimeComboBox Class Reference

#include <ktimecombobox.h>

Inheritance diagram for KTimeComboBox:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Option { EditTime = 0x0001, SelectTime = 0x0002, ForceTime = 0x0004, WarnOnInvalid = 0x0008 }

Public Slots

void setDisplayFormat (KLocale::TimeFormatOptions formatOptions)
void setMaximumTime (const QTime &maxTime, const QString &maxWarnMsg=QString())
void setMinimumTime (const QTime &minTime, const QString &minWarnMsg=QString())
void setOptions (Options options)
void setTime (const QTime &time)
void setTimeList (QList< QTime > timeList, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString())
void setTimeListInterval (int minutes)

Signals

void timeChanged (const QTime &time)
void timeEdited (const QTime &time)
void timeEntered (const QTime &time)

Public Member Functions

 KTimeComboBox (QWidget *parent=0)
virtual ~KTimeComboBox ()
KLocale::TimeFormatOptions displayFormat () const
bool isNull () const
bool isValid () const
QTime maximumTime () const
QTime minimumTime () const
Options options () const
void resetMaximumTime ()
void resetMinimumTime ()
void resetTimeRange ()
void setTimeRange (const QTime &minTime, const QTime &maxTime, const QString &minWarnMsg=QString(), const QString &maxWarnMsg=QString())
QTime time () const
QList< QTime > timeList () const
int timeListInterval () const

Protected Member Functions

virtual void assignTime (const QTime &time)
virtual bool eventFilter (QObject *object, QEvent *event)
virtual void focusInEvent (QFocusEvent *event)
virtual void focusOutEvent (QFocusEvent *event)
virtual void hidePopup ()
virtual void keyPressEvent (QKeyEvent *event)
virtual void mousePressEvent (QMouseEvent *event)
virtual void resizeEvent (QResizeEvent *event)
virtual void showPopup ()
virtual void wheelEvent (QWheelEvent *event)

Properties

QTime maximumTime
QTime minimumTime
Options options
QTime time
int timeListInterval

Member Enumeration Documentation

enum KTimeComboBox::Option

Options provided by the widget.

See also:
options
setOptions
Enumerator:
EditTime 

Allow the user to manually edit the time in the combo line edit.

SelectTime 

Allow the user to select the time from a drop-down menu.

ForceTime 

Any set or entered time will be forced to one of the drop-down times.

WarnOnInvalid 

Show a warning box on focus out if the user enters an invalid time.

Definition at line 50 of file ktimecombobox.h.


Constructor & Destructor Documentation

KTimeComboBox::KTimeComboBox ( QWidget *  parent = 0) [explicit]

Create a new KTimeComboBox widget.

Definition at line 280 of file ktimecombobox.cpp.

KTimeComboBox::~KTimeComboBox ( ) [virtual]

Destroy the widget.

Definition at line 296 of file ktimecombobox.cpp.


Member Function Documentation

void KTimeComboBox::assignTime ( const QTime &  time) [protected, virtual]

Assign the time for the widget.

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

Parameters:
timethe new time

Definition at line 323 of file ktimecombobox.cpp.

KLocale::TimeFormatOptions KTimeComboBox::displayFormat ( ) const

Return the currently set time format.

By default this is the Short Time

Returns:
the currently set time format

Definition at line 408 of file ktimecombobox.cpp.

bool KTimeComboBox::eventFilter ( QObject *  o,
QEvent *  ev 
) [protected, virtual]

Re-implemented for internal reasons.

API not affected.

Reimplemented from KComboBox.

Definition at line 474 of file ktimecombobox.cpp.

void KTimeComboBox::focusInEvent ( QFocusEvent *  event) [protected, virtual]

Definition at line 531 of file ktimecombobox.cpp.

void KTimeComboBox::focusOutEvent ( QFocusEvent *  event) [protected, virtual]

Definition at line 504 of file ktimecombobox.cpp.

void KTimeComboBox::hidePopup ( ) [protected, virtual]

Definition at line 516 of file ktimecombobox.cpp.

bool KTimeComboBox::isNull ( ) const

Return if the current user input is null.

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

Definition at line 336 of file ktimecombobox.cpp.

bool KTimeComboBox::isValid ( ) const

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

Definition at line 328 of file ktimecombobox.cpp.

void KTimeComboBox::keyPressEvent ( QKeyEvent *  event) [protected, virtual]

Definition at line 479 of file ktimecombobox.cpp.

QTime KTimeComboBox::maximumTime ( ) const

Return the current maximum time.

Returns:
the current maximum time
QTime KTimeComboBox::minimumTime ( ) const

Return the current minimum time.

Returns:
the current minimum time
void KTimeComboBox::mousePressEvent ( QMouseEvent *  event) [protected, virtual]

Definition at line 521 of file ktimecombobox.cpp.

Options KTimeComboBox::options ( ) const

Return the currently set widget options.

Returns:
the currently set widget options
void KTimeComboBox::resetMaximumTime ( )

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

Definition at line 380 of file ktimecombobox.cpp.

void KTimeComboBox::resetMinimumTime ( )

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

Definition at line 365 of file ktimecombobox.cpp.

void KTimeComboBox::resetTimeRange ( )

Reset the minimum and maximum time to the default values.

Definition at line 403 of file ktimecombobox.cpp.

void KTimeComboBox::resizeEvent ( QResizeEvent *  event) [protected, virtual]

Definition at line 536 of file ktimecombobox.cpp.

void KTimeComboBox::setDisplayFormat ( KLocale::TimeFormatOptions  formatOptions) [slot]

Sets the time format to display.

By default is the Short Time format.

Parameters:
formatthe time format to use

Definition at line 413 of file ktimecombobox.cpp.

void KTimeComboBox::setMaximumTime ( const QTime &  maxTime,
const QString &  maxWarnMsg = QString() 
) [slot]

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()
maximumTime()
setMaximumTime()
setTimeRange()
Parameters:
maxTimethe maximum time
maxWarnMsgthe maximum warning message

Definition at line 375 of file ktimecombobox.cpp.

void KTimeComboBox::setMinimumTime ( const QTime &  minTime,
const QString &  minWarnMsg = QString() 
) [slot]

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()
maximumTime()
setMaximumTime()
setTimeRange()
Parameters:
minTimethe minimum time
minWarnMsgthe minimum warning message

Definition at line 360 of file ktimecombobox.cpp.

void KTimeComboBox::setOptions ( Options  options) [slot]

Set the new widget options.

Parameters:
optionsthe new widget options

Definition at line 346 of file ktimecombobox.cpp.

void KTimeComboBox::setTime ( const QTime &  time) [slot]

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:
timethe new time

Definition at line 307 of file ktimecombobox.cpp.

void KTimeComboBox::setTimeList ( QList< QTime >  timeList,
const QString &  minWarnMsg = QString(),
const QString &  maxWarnMsg = QString() 
) [slot]

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:
timeListthe list of times able to be selected
minWarnMsgthe minimum warning message
maxWarnMsgthe maximum warning message

Definition at line 457 of file ktimecombobox.cpp.

void KTimeComboBox::setTimeListInterval ( int  minutes) [slot]

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

The combo drop-down will be populated with times every

Parameters:
minutesapart, 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:
minutesthe time list interval to display

Definition at line 427 of file ktimecombobox.cpp.

void KTimeComboBox::setTimeRange ( const QTime &  minTime,
const QTime &  maxTime,
const QString &  minWarnMsg = QString(),
const 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:
minTimethe minimum time
maxTimethe maximum time
minWarnMsgthe minimum warning message
maxWarnMsgthe maximum warning message

Definition at line 385 of file ktimecombobox.cpp.

void KTimeComboBox::showPopup ( ) [protected, virtual]

Definition at line 511 of file ktimecombobox.cpp.

QTime KTimeComboBox::time ( ) const

Return the currently selected time.

Returns:
the currently selected time
void KTimeComboBox::timeChanged ( const QTime &  time) [signal]

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

The returned time may be invalid.

Parameters:
timethe new time
void KTimeComboBox::timeEdited ( const QTime &  time) [signal]

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

The returned time may be invalid.

Parameters:
timethe new time
void KTimeComboBox::timeEntered ( const QTime &  time) [signal]

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

The returned time may be invalid.

Parameters:
timethe new time
QList< QTime > KTimeComboBox::timeList ( ) const

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

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

Definition at line 446 of file ktimecombobox.cpp.

int KTimeComboBox::timeListInterval ( ) const

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
void KTimeComboBox::wheelEvent ( QWheelEvent *  event) [protected, virtual]

Reimplemented from KComboBox.

Definition at line 526 of file ktimecombobox.cpp.


Property Documentation

QTime KTimeComboBox::maximumTime [read, write]

Definition at line 38 of file ktimecombobox.h.

QTime KTimeComboBox::minimumTime [read, write]

Definition at line 37 of file ktimecombobox.h.

KTimeComboBox::Options KTimeComboBox::options [read, write]

Definition at line 40 of file ktimecombobox.h.

QTime KTimeComboBox::time [read, write]

Definition at line 36 of file ktimecombobox.h.

int KTimeComboBox::timeListInterval [read, write]

Definition at line 39 of file ktimecombobox.h.


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

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

Skip menu "kdelibs"
  • 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.7.5
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