KDE PIM / Developers / API Docs / kalarm

TimeSpinBox Class Reference

Hours/minutes time entry widget. More...

#include <timespinbox.h>

Inherits SpinBox2.

List of all members.

Public Slots

Public Member Functions

Static Public Member Functions

Protected Member Functions


Detailed Description

Hours/minutes time entry widget.

The TimeSpinBox class provides a widget to enter a time consisting of an hours/minutes value. It can hold a time in any of 3 modes: a time of day using the 24-hour clock; a time of day using the 12-hour clock; or a length of time not restricted to 24 hours.

Derived from SpinBox2, it displays a spin box with two pairs of spin buttons, one for hours and one for minutes. It provides accelerated stepping using the spin buttons, when the shift key is held down (inherited from SpinBox2). The default shift steps are 5 minutes and 6 hours.

The widget may be set as read-only. This has the same effect as disabling it, except that its appearance is unchanged.

Author:
David Jarvie <software@astrojar.org.uk>


Constructor & Destructor Documentation

TimeSpinBox::TimeSpinBox bool  use24hour,
QWidget *  parent = 0,
const char *  name = 0
 

Constructor for a wrapping time spin box which can be used to enter a time of day.

Parameters:
use24hour True for entry of 24-hour clock times (range 00:00 to 23:59). False for entry of 12-hour clock times (range 12:00 to 11:59).
parent The parent object of this widget.
name The name of this widget.

TimeSpinBox::TimeSpinBox int  minMinute,
int  maxMinute,
QWidget *  parent = 0,
const char *  name = 0
 

Constructor for a non-wrapping time spin box which can be used to enter a length of time.

Parameters:
minMinute The minimum value which the spin box can hold, in minutes.
maxMinute The maximum value which the spin box can hold, in minutes.
parent The parent object of this widget.
name The name of this widget.

Member Function Documentation

bool TimeSpinBox::isValid  )  const
 

Returns true if the spin box holds a valid value.

An invalid value is displayed as asterisks.

void TimeSpinBox::setValid bool   ) 
 

Sets the spin box as holding a valid or invalid value.

If newly invalid, the value is displayed as asterisks. If newly valid, the value is set to the minimum value.

QTime TimeSpinBox::time  )  const
 

Returns the current value held in the spin box.

If an invalid value is displayed, returns a value lower than the minimum value.

void TimeSpinBox::setMaxValue int  minutes  )  [inline]
 

Sets the maximum value which can be held in the spin box.

Parameters:
minutes The maximum value expressed in minutes.

Reimplemented from SpinBox2.

void TimeSpinBox::setMaxValue const QTime &  t  )  [inline]
 

Sets the maximum value which can be held in the spin box.

QTime TimeSpinBox::maxTime  )  const [inline]
 

Returns the maximum value which can be held in the spin box.

QString TimeSpinBox::shiftWhatsThis  )  [static]
 

Returns a text describing use of the shift key as an accelerator for the spin buttons, designed for incorporation into WhatsThis texts.

void TimeSpinBox::setValue int  minutes  )  [virtual, slot]
 

Sets the value of the spin box.

Parameters:
minutes The new value of the spin box, expressed in minutes.

Reimplemented from SpinBox2.

void TimeSpinBox::setValue const QTime &  t  )  [inline, slot]
 

Sets the value of the spin box.

void TimeSpinBox::stepUp  )  [virtual, slot]
 

Increments the spin box value.

If the value was previously invalid, the spin box is set to the minimum value.

Reimplemented from SpinBox2.

void TimeSpinBox::stepDown  )  [virtual, slot]
 

Decrements the spin box value.

If the value was previously invalid, the spin box is set to the minimum value.

Reimplemented from SpinBox2.


The documentation for this class was generated from the following files: