1QTimeEdit(3qt) QTimeEdit(3qt)
2
3
4
6 QTimeEdit - Time editor
7
9 #include <qdatetimeedit.h>
10
11 Inherits QDateTimeEditBase.
12
13 Public Members
14 enum Display { Hours = 0x01, Minutes = 0x02, Seconds = 0x04, AMPM =
15 0x10 }
16 QTimeEdit ( QWidget * parent = 0, const char * name = 0 )
17 QTimeEdit ( const QTime & time, QWidget * parent = 0, const char * name
18 = 0 )
19 ~QTimeEdit ()
20 QTime time () const
21 virtual void setAutoAdvance ( bool advance )
22 bool autoAdvance () const
23 virtual void setMinValue ( const QTime & d )
24 QTime minValue () const
25 virtual void setMaxValue ( const QTime & d )
26 QTime maxValue () const
27 virtual void setRange ( const QTime & min, const QTime & max )
28 QString separator () const
29 virtual void setSeparator ( const QString & s )
30 uint display () const
31 void setDisplay ( uint disp )
32
33 Public Slots
34 virtual void setTime ( const QTime & time )
35
36 Signals
37 void valueChanged ( const QTime & time )
38
39 Properties
40 bool autoAdvance - whether the editor automatically advances to the
41 next section
42 Display display - the sections that are displayed in the time edit
43 QTime maxValue - the maximum time value
44 QTime minValue - the minimum time value
45 QTime time - the editor's time value
46
47 Protected Members
48 virtual QString sectionFormattedText ( int sec )
49 virtual void setHour ( int h )
50 virtual void setMinute ( int m )
51 virtual void setSecond ( int s )
52
54 The QTimeEdit class provides a time editor.
55
56 QTimeEdit allows the user to edit times by using the keyboard or the
57 arrow keys to increase/decrease time values. The arrow keys can be used
58 to move from section to section within the QTimeEdit box. The user can
59 automatically be moved to the next section once they complete a section
60 using setAutoAdvance(). Times appear in hour, minute, second order. It
61 is recommended that the QTimeEdit is initialised with a time, e.g.
62
63 QTime timeNow = QTime::currentTime();
64 QTimeEdit *timeEdit = new QTimeEdit( timeNow, this );
65 timeEdit->setRange( timeNow, timeNow.addSecs( 60 * 60 ) );
66 Here we've created a QTimeEdit widget set to the current time. We've
67 also set the minimum value to the current time and the maximum time to
68 one hour from now.
69
70 The maximum and minimum values for a time value in the time editor
71 default to the maximum and minimum values for a QTime. You can change
72 this by calling setMinValue(), setMaxValue() or setRange().
73
74 Terminology: A QTimeWidget consists of three sections, one each for the
75 hour, minute and second. You can change the separator character using
76 setSeparator(), by default the separator is read from the system's
77 settings.
78
79 <center>
80 [Image Omitted]
81
82 </center>
83
84 See also QTime, QDateEdit, QDateTimeEdit, Advanced Widgets, and Time
85 and Date.
86
87 Member Type Documentation
89 This enum defines the sections that comprise a time
90
91 QTimeEdit::Hours - The hours section
92
93 QTimeEdit::Minutes - The minutes section
94
95 QTimeEdit::Seconds - The seconds section
96
97 QTimeEdit::AMPM - The AM/PM section
98
99 The values can be or'ed together to show any combination.
100
103 Constructs an empty time edit with parent parent and called name.
104
106 name = 0 )
107 This is an overloaded member function, provided for convenience. It
108 behaves essentially like the above function.
109
110 Constructs a time edit with the initial time value, time, parent parent
111 and called name.
112
114 Destroys the object and frees any allocated resources.
115
117 Returns TRUE if the editor automatically advances to the next section;
118 otherwise returns FALSE. See the "autoAdvance" property for details.
119
121 Returns the sections that are displayed in the time edit. See the
122 "display" property for details.
123
125 Returns the maximum time value. See the "maxValue" property for
126 details.
127
129 Returns the minimum time value. See the "minValue" property for
130 details.
131
133 Returns the formatted number for section sec. This will correspond to
134 either the hour, minute or second section, depending on sec.
135
137 Returns the editor's separator.
138
140 Sets whether the editor automatically advances to the next section to
141 advance. See the "autoAdvance" property for details.
142
144 Sets the sections that are displayed in the time edit to disp. See the
145 "display" property for details.
146
148 Sets the hour to h, which must be a valid hour, i.e. in the range
149 0..24.
150
152 Sets the maximum time value to d. See the "maxValue" property for
153 details.
154
156 Sets the minimum time value to d. See the "minValue" property for
157 details.
158
160 Sets the minute to m, which must be a valid minute, i.e. in the range
161 0..59.
162
164 Sets the valid input range for the editor to be from min to max
165 inclusive. If min is invalid no minimum time is set. Similarly, if max
166 is invalid no maximum time is set.
167
169 Sets the second to s, which must be a valid second, i.e. in the range
170 0..59.
171
173 Sets the separator to s. Note that currently only the first character
174 of s is used.
175
177 Sets the editor's time value to time. See the "time" property for
178 details.
179
181 Returns the editor's time value. See the "time" property for details.
182
184 This signal is emitted whenever the editor's value changes. The time
185 parameter is the new value.
186
187 Property Documentation
189 This property holds whether the editor automatically advances to the
190 next section.
191
192 If autoAdvance is TRUE, the editor will automatically advance focus to
193 the next time section if a user has completed a section. The default is
194 FALSE.
195
196 Set this property's value with setAutoAdvance() and get this property's
197 value with autoAdvance().
198
200 This property holds the sections that are displayed in the time edit.
201
202 The value can be any combination of the values in the Display enum. By
203 default, the widget displays hours, minutes and seconds.
204
205 Set this property's value with setDisplay() and get this property's
206 value with display().
207
209 This property holds the maximum time value.
210
211 Setting the maximum time value is equivalent to calling
212 QTimeEdit::setRange( minValue(), t ), where t is the maximum time. The
213 default maximum time is 23:59:59.
214
215 See also minValue and setRange().
216
217 Set this property's value with setMaxValue() and get this property's
218 value with maxValue().
219
221 This property holds the minimum time value.
222
223 Setting the minimum time value is equivalent to calling
224 QTimeEdit::setRange( t, maxValue() ), where t is the minimum time. The
225 default minimum time is 00:00:00.
226
227 See also maxValue and setRange().
228
229 Set this property's value with setMinValue() and get this property's
230 value with minValue().
231
233 This property holds the editor's time value.
234
235 When changing the time property, if the time is less than minValue(),
236 or is greater than maxValue(), nothing happens.
237
238 Set this property's value with setTime() and get this property's value
239 with time().
240
241
243 http://doc.trolltech.com/qtimeedit.html
244 http://www.trolltech.com/faq/tech.html
245
247 Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
248 license file included in the distribution for a complete license
249 statement.
250
252 Generated automatically from the source code.
253
255 If you find a bug in Qt, please report it as described in
256 http://doc.trolltech.com/bughowto.html. Good bug reports help us to
257 help you. Thank you.
258
259 The definitive Qt documentation is provided in HTML format; it is
260 located at $QTDIR/doc/html and can be read using Qt Assistant or with a
261 web browser. This man page is provided as a convenience for those users
262 who prefer man pages, although this format is not officially supported
263 by Trolltech.
264
265 If you find errors in this manual page, please report them to qt-
266 bugs@trolltech.com. Please include the name of the manual page
267 (qtimeedit.3qt) and the Qt version (3.3.8).
268
269
270
271Trolltech AS 2 February 2007 QTimeEdit(3qt)