KDE PIM / Developers / API Docs / kalarm

TimePeriod Class Reference

The TimePeriod class provides a widget for entering a time period as a number of weeks, days, or hours and minutes. Time period entry widget. More...

#include <timeperiod.h>

Inherits QHBox.

List of all members.

Public Types

Signals

Public Member Functions

Static Public Member Functions


Detailed Description

The TimePeriod class provides a widget for entering a time period as a number of weeks, days, or hours and minutes. Time period entry widget.

It displays a combo box to select the time units (weeks, days or hours and minutes) alongside a spin box to enter the number of units. The type of spin box displayed alters according to the units selection: day and week values are entered in a normal spin box, while hours and minutes are entered in a time spin box (with two pairs of spin buttons, one for hours and one for minutes).

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>


Member Enumeration Documentation

enum TimePeriod::Units
 

Units for the time period.

  • HOURS_MINUTES - the time period is entered as an hours/minutes value.
  • DAYS - the time period is entered as a number of days.
  • WEEKS - the time period is entered as a number of weeks.

Constructor & Destructor Documentation

TimePeriod::TimePeriod bool  allowHourMinute,
QWidget *  parent,
const char *  name = 0
 

Constructor.

Parameters:
allowHourMinute Set false to prevent hours/minutes from being allowed as units; only days and weeks can ever be used, regardless of other method calls. Set true to allow hours/minutes, days or weeks as units.
parent The parent object of this widget.
name The name of this widget.

Member Function Documentation

bool TimePeriod::isReadOnly  )  const [inline]
 

Returns true if the widget is read only.

void TimePeriod::setReadOnly bool  readOnly  ) 
 

Sets whether the widget is read-only for the user.

If read-only, the time period cannot be edited and the units combo box is inactive.

Parameters:
readOnly True to set the widget read-only, false to set it read-write.

int TimePeriod::minutes  )  const
 

Gets the entered time period expressed in minutes.

void TimePeriod::setMinutes int  minutes,
bool  dateOnly,
Units  defaultUnits
 

Initialises the time period value.

Parameters:
minutes The value of the time period to set, expressed as a number of minutes.
dateOnly True to restrict the units available in the combo box to days or weeks.
defaultUnits The units to display initially in the combo box.

void TimePeriod::setDateOnly bool  dateOnly  )  [inline]
 

Enables or disables hours/minutes units in the combo box.

To disable hours/minutes, set dateOnly true; to enable hours/minutes, set dateOnly false. But note that hours/minutes cannot be enabled if it was disallowed in the constructor.

void TimePeriod::setMaximum int  hourmin,
int  days
 

Sets the maximum values for the hours/minutes and days/weeks spin boxes.

Set hourmin = 0 to leave the hours/minutes maximum unchanged.

void TimePeriod::setSelectOnStep bool  select  ) 
 

Sets whether the editor text is to be selected whenever spin buttons are clicked.

The default is to select it.

void TimePeriod::setFocusOnCount  ) 
 

Sets the input focus to the count field.

void TimePeriod::setWhatsThis const QString &  units,
const QString &  dayWeek,
const QString &  hourMin = QString::null
 

Sets separate WhatsThis texts for the count spin boxes and the units combo box.

If is omitted, both spin boxes are set to the same WhatsThis text.

void TimePeriod::valueChanged int  minutes  )  [signal]
 

This signal is emitted whenever the value held in the widget changes.

Parameters:
minutes The current value of the time period, expressed in minutes.

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