kalarm/lib

#include <timeedit.h>

Inherits TQHBox.

Public Slots

virtual void setValue (int minutes)
 
void setValue (const TQTime &t)
 

Signals

void valueChanged (int minutes)
 

Public Member Functions

 TimeEdit (TQWidget *parent=0, const char *name=0)
 
bool isReadOnly () const
 
virtual void setReadOnly (bool readOnly)
 
bool isValid () const
 
void setValid (bool valid)
 
int value () const
 
TQTime time () const
 
bool wrapping () const
 
void setWrapping (bool on)
 
int minValue () const
 
int maxValue () const
 
TQTime maxTime () const
 
void setMinValue (int minutes)
 
void setMaxValue (int minutes)
 
void setMaxValue (const TQTime &time)
 

Detailed Description

Widget to enter a time of day.

The TimeEdit class provides a widget to enter a time of day in hours and minutes, using a 12- or 24-hour clock according to the user's locale settings.

It displays a TimeSpinBox widget to enter hours and minutes. If a 12-hour clock is being used, it also displays a combo box to select am or pm.

TimeSpinBox 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 softw.nosp@m.are@.nosp@m.astro.nosp@m.jar..nosp@m.org.u.nosp@m.k

Definition at line 50 of file timeedit.h.

Constructor & Destructor Documentation

◆ TimeEdit()

TimeEdit::TimeEdit ( TQWidget *  parent = 0,
const char *  name = 0 
)
explicit

Constructor.

Parameters
parentThe parent object of this widget.
nameThe name of this widget.

Definition at line 31 of file timeedit.cpp.

Member Function Documentation

◆ isReadOnly()

bool TimeEdit::isReadOnly ( ) const
inline

Returns true if the widget is read only.

Definition at line 61 of file timeedit.h.

◆ isValid()

bool TimeEdit::isValid ( ) const

Returns true if the widget contains a valid value.

Definition at line 67 of file timeedit.cpp.

◆ maxTime()

TQTime TimeEdit::maxTime ( ) const
inline

Returns the maximum value of the widget as a TQTime value.

Definition at line 91 of file timeedit.h.

◆ maxValue()

int TimeEdit::maxValue ( ) const

Returns the maximum value of the widget in minutes.

Definition at line 116 of file timeedit.cpp.

◆ minValue()

int TimeEdit::minValue ( ) const

Returns the minimum value of the widget in minutes.

Definition at line 111 of file timeedit.cpp.

◆ setMaxValue() [1/2]

void TimeEdit::setMaxValue ( const TQTime &  time)
inline

Sets the maximum value of the widget.

Definition at line 97 of file timeedit.h.

◆ setMaxValue() [2/2]

void TimeEdit::setMaxValue ( int  minutes)

Sets the maximum value of the widget.

Definition at line 128 of file timeedit.cpp.

◆ setMinValue()

void TimeEdit::setMinValue ( int  minutes)

Sets the minimum value of the widget.

Definition at line 121 of file timeedit.cpp.

◆ setReadOnly()

void TimeEdit::setReadOnly ( bool  readOnly)
virtual

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

If read-only, the time cannot be edited and the spin buttons and am/pm combo box are inactive.

Parameters
readOnlyTrue to set the widget read-only, false to set it read-write.

Definition at line 51 of file timeedit.cpp.

◆ setValid()

void TimeEdit::setValid ( bool  valid)

Sets whether the edit value is valid.

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

Parameters
validTrue to set the value valid, false to set it invalid.

Definition at line 77 of file timeedit.cpp.

◆ setValue [1/2]

void TimeEdit::setValue ( const TQTime &  t)
inlineslot

Sets the value of the widget.

Definition at line 102 of file timeedit.h.

◆ setValue [2/2]

void TimeEdit::setValue ( int  minutes)
virtualslot

Sets the value of the widget.

Definition at line 91 of file timeedit.cpp.

◆ setWrapping()

void TimeEdit::setWrapping ( bool  on)

Sets whether it is possible to step the value from the highest value to the lowest value and vice versa.

Parameters
onTrue to enable wrapping, else false.

Definition at line 106 of file timeedit.cpp.

◆ time()

TQTime TimeEdit::time ( ) const
inline

Returns the entered time as a TQTime value.

Definition at line 79 of file timeedit.h.

◆ value()

int TimeEdit::value ( ) const

Returns the entered time as a value in minutes.

Definition at line 62 of file timeedit.cpp.

◆ valueChanged

void TimeEdit::valueChanged ( int  minutes)
signal

This signal is emitted every time the value of the widget changes (for whatever reason).

Parameters
minutesThe new value.

◆ wrapping()

bool TimeEdit::wrapping ( ) const

Returns true if it is possible to step the value from the highest value to the lowest value and vice versa.

Definition at line 101 of file timeedit.cpp.


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