summaryrefslogtreecommitdiffstats
path: root/doc/man/man3/tqtimeedit.3qt
blob: 2f57919faf796531cfafbb29f303719c3a53aa1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
'\" t
.TH TQTimeEdit 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA.  All rights reserved.  See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
TQTimeEdit \- Time editor
.SH SYNOPSIS
\fC#include <tqdatetimeedit.h>\fR
.PP
Inherits TQDateTimeEditBase.
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "enum \fBDisplay\fR { Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM = 0x10 }"
.br
.ti -1c
.BI "\fBTQTimeEdit\fR ( TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fBTQTimeEdit\fR ( const TQTime & time, TQWidget * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~TQTimeEdit\fR ()"
.br
.ti -1c
.BI "TQTime \fBtime\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetAutoAdvance\fR ( bool advance )"
.br
.ti -1c
.BI "bool \fBautoAdvance\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetMinValue\fR ( const TQTime & d )"
.br
.ti -1c
.BI "TQTime \fBminValue\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetMaxValue\fR ( const TQTime & d )"
.br
.ti -1c
.BI "TQTime \fBmaxValue\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetRange\fR ( const TQTime & min, const TQTime & max )"
.br
.ti -1c
.BI "TQString \fBseparator\fR () const"
.br
.ti -1c
.BI "virtual void \fBsetSeparator\fR ( const TQString & s )"
.br
.ti -1c
.BI "uint \fBdisplay\fR () const"
.br
.ti -1c
.BI "void \fBsetDisplay\fR ( uint disp )"
.br
.in -1c
.SS "Public Slots"
.in +1c
.ti -1c
.BI "virtual void \fBsetTime\fR ( const TQTime & time )"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBvalueChanged\fR ( const TQTime & time )"
.br
.in -1c
.SS "Properties"
.in +1c
.ti -1c
.BI "bool \fBautoAdvance\fR - whether the editor automatically advances to the next section"
.br
.ti -1c
.BI "Display \fBdisplay\fR - the sections that are displayed in the time edit"
.br
.ti -1c
.BI "TQTime \fBmaxValue\fR - the maximum time value"
.br
.ti -1c
.BI "TQTime \fBminValue\fR - the minimum time value"
.br
.ti -1c
.BI "TQTime \fBtime\fR - the editor's time value"
.br
.in -1c
.SS "Protected Members"
.in +1c
.ti -1c
.BI "virtual TQString \fBsectionFormattedText\fR ( int sec )"
.br
.ti -1c
.BI "virtual void \fBsetHour\fR ( int h )"
.br
.ti -1c
.BI "virtual void \fBsetMinute\fR ( int m )"
.br
.ti -1c
.BI "virtual void \fBsetSecond\fR ( int s )"
.br
.in -1c
.SH DESCRIPTION
The TQTimeEdit class provides a time editor.
.PP
TQTimeEdit allows the user to edit times by using the keyboard or the arrow keys to increase/decrease time values. The arrow keys can be used to move from section to section within the TQTimeEdit box. The user can automatically be moved to the next section once they complete a section using setAutoAdvance(). Times appear in hour, minute, second order. It is recommended that the TQTimeEdit is initialised with a time, e.g.
.PP
.nf
.br
    TQTime timeNow = TQTime::currentTime();
.br
    TQTimeEdit *timeEdit = new TQTimeEdit( timeNow, this );
.br
    timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) );
.br
.fi
Here we've created a TQTimeEdit widget set to the current time. We've also set the minimum value to the current time and the maximum time to one hour from now.
.PP
The maximum and minimum values for a time value in the time editor default to the maximum and minimum values for a TQTime. You can change this by calling setMinValue(), setMaxValue() or setRange().
.PP
Terminology: A TQTimeWidget consists of three sections, one each for the hour, minute and second. You can change the separator character using setSeparator(), by default the separator is read from the system's settings.
.PP
<center>
.ce 1
.B "[Image Omitted]"
.PP
</center>
.PP
See also TQTime, TQDateEdit, TQDateTimeEdit, Advanced Widgets, and Time and Date.
.SS "Member Type Documentation"
.SH "TQTimeEdit::Display"
This enum defines the sections that comprise a time
.TP
\fCTQTimeEdit::Hours\fR - The hours section
.TP
\fCTQTimeEdit::Minutes\fR - The minutes section
.TP
\fCTQTimeEdit::Seconds\fR - The seconds section
.TP
\fCTQTimeEdit::AMPM\fR - The AM/PM section
.PP
The values can be or'ed together to show any combination.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "TQTimeEdit::TQTimeEdit ( TQWidget * parent = 0, const char * name = 0 )"
Constructs an empty time edit with parent \fIparent\fR and called \fIname\fR.
.SH "TQTimeEdit::TQTimeEdit ( const TQTime & time, TQWidget * parent = 0, const char * name = 0 )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Constructs a time edit with the initial time value, \fItime\fR, parent \fIparent\fR and called \fIname\fR.
.SH "TQTimeEdit::~TQTimeEdit ()"
Destroys the object and frees any allocated resources.
.SH "bool TQTimeEdit::autoAdvance () const"
Returns TRUE if the editor automatically advances to the next section; otherwise returns FALSE. See the "autoAdvance" property for details.
.SH "uint TQTimeEdit::display () const"
Returns the sections that are displayed in the time edit. See the "display" property for details.
.SH "TQTime TQTimeEdit::maxValue () const"
Returns the maximum time value. See the "maxValue" property for details.
.SH "TQTime TQTimeEdit::minValue () const"
Returns the minimum time value. See the "minValue" property for details.
.SH "TQString TQTimeEdit::sectionFormattedText ( int sec )\fC [virtual protected]\fR"
Returns the formatted number for section \fIsec\fR. This will correspond to either the hour, minute or second section, depending on \fIsec\fR.
.SH "TQString TQTimeEdit::separator () const"
Returns the editor's separator.
.SH "void TQTimeEdit::setAutoAdvance ( bool advance )\fC [virtual]\fR"
Sets whether the editor automatically advances to the next section to \fIadvance\fR. See the "autoAdvance" property for details.
.SH "void TQTimeEdit::setDisplay ( uint disp )"
Sets the sections that are displayed in the time edit to \fIdisp\fR. See the "display" property for details.
.SH "void TQTimeEdit::setHour ( int h )\fC [virtual protected]\fR"
Sets the hour to \fIh\fR, which must be a valid hour, i.e. in the range 0..24.
.SH "void TQTimeEdit::setMaxValue ( const TQTime & d )\fC [virtual]\fR"
Sets the maximum time value to \fId\fR. See the "maxValue" property for details.
.SH "void TQTimeEdit::setMinValue ( const TQTime & d )\fC [virtual]\fR"
Sets the minimum time value to \fId\fR. See the "minValue" property for details.
.SH "void TQTimeEdit::setMinute ( int m )\fC [virtual protected]\fR"
Sets the minute to \fIm\fR, which must be a valid minute, i.e. in the range 0..59.
.SH "void TQTimeEdit::setRange ( const TQTime & min, const TQTime & max )\fC [virtual]\fR"
Sets the valid input range for the editor to be from \fImin\fR to \fImax\fR inclusive. If \fImin\fR is invalid no minimum time is set. Similarly, if \fImax\fR is invalid no maximum time is set.
.SH "void TQTimeEdit::setSecond ( int s )\fC [virtual protected]\fR"
Sets the second to \fIs\fR, which must be a valid second, i.e. in the range 0..59.
.SH "void TQTimeEdit::setSeparator ( const TQString & s )\fC [virtual]\fR"
Sets the separator to \fIs\fR. Note that currently only the first character of \fIs\fR is used.
.SH "void TQTimeEdit::setTime ( const TQTime & time )\fC [virtual slot]\fR"
Sets the editor's time value to \fItime\fR. See the "time" property for details.
.SH "TQTime TQTimeEdit::time () const"
Returns the editor's time value. See the "time" property for details.
.SH "void TQTimeEdit::valueChanged ( const TQTime & time )\fC [signal]\fR"
This signal is emitted whenever the editor's value changes. The \fItime\fR parameter is the new value.
.SS "Property Documentation"
.SH "bool autoAdvance"
This property holds whether the editor automatically advances to the next section.
.PP
If autoAdvance is TRUE, the editor will automatically advance focus to the next time section if a user has completed a section. The default is FALSE.
.PP
Set this property's value with setAutoAdvance() and get this property's value with autoAdvance().
.SH "Display display"
This property holds the sections that are displayed in the time edit.
.PP
The value can be any combination of the values in the Display enum. By default, the widget displays hours, minutes and seconds.
.PP
Set this property's value with setDisplay() and get this property's value with display().
.SH "TQTime maxValue"
This property holds the maximum time value.
.PP
Setting the maximum time value is equivalent to calling TQTimeEdit::setRange( minValue(), \fIt\fR ), where \fIt\fR is the maximum time. The default maximum time is 23:59:59.
.PP
See also minValue and setRange().
.PP
Set this property's value with setMaxValue() and get this property's value with maxValue().
.SH "TQTime minValue"
This property holds the minimum time value.
.PP
Setting the minimum time value is equivalent to calling TQTimeEdit::setRange( \fIt\fR, maxValue() ), where \fIt\fR is the minimum time. The default minimum time is 00:00:00.
.PP
See also maxValue and setRange().
.PP
Set this property's value with setMinValue() and get this property's value with minValue().
.SH "TQTime time"
This property holds the editor's time value.
.PP
When changing the time property, if the time is less than minValue(), or is greater than maxValue(), nothing happens.
.PP
Set this property's value with setTime() and get this property's value with time().

.SH "SEE ALSO"
.BR http://doc.trolltech.com/tqtimeedit.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com.  See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive TQt documentation is provided in HTML format; it is
located at $TQTDIR/doc/html and can be read using TQt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech. 
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (tqtimeedit.3qt) and the Qt
version (3.3.8).