~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3timeedit.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/qt3support/widgets/q3datetimeedit.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3TimeEdit Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3TimeEdit Class Reference</h1>
 
21
<p>The Q3TimeEdit class provides a time editor. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3TimeEdit&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="q3datetimeeditbase.html">Q3DateTimeEditBase</a>.</p>
 
25
<ul>
 
26
<li><a href="q3timeedit-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-types"></a>
 
29
<h3>Public Types</h3>
 
30
<ul>
 
31
<li><div class="fn"/>enum <b><a href="q3timeedit.html#Display-enum">Display</a></b> { Hours, Minutes, Seconds, AMPM }</li>
 
32
</ul>
 
33
<a name="properties"></a>
 
34
<h3>Properties</h3>
 
35
<table width="100%" border="0" cellpadding="0" cellspacing="0">
 
36
<tr><td width="45%" valign="top"><ul>
 
37
<li><div class="fn"/><b><a href="q3timeedit.html#autoAdvance-prop">autoAdvance</a></b> : bool</li>
 
38
<li><div class="fn"/><b><a href="q3timeedit.html#display-prop">display</a></b> : Display</li>
 
39
<li><div class="fn"/><b><a href="q3timeedit.html#maxValue-prop">maxValue</a></b> : QTime</li>
 
40
</ul></td><td valign="top"><ul>
 
41
<li><div class="fn"/><b><a href="q3timeedit.html#minValue-prop">minValue</a></b> : QTime</li>
 
42
<li><div class="fn"/><b><a href="q3timeedit.html#time-prop">time</a></b> : QTime</li>
 
43
</ul>
 
44
</td></tr>
 
45
</table>
 
46
<ul>
 
47
<li><div class="fn"/>52 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
 
48
<li><div class="fn"/>1 property inherited from <a href="qobject.html#properties">QObject</a></li>
 
49
</ul>
 
50
<a name="public-functions"></a>
 
51
<h3>Public Functions</h3>
 
52
<ul>
 
53
<li><div class="fn"/><b><a href="q3timeedit.html#Q3TimeEdit">Q3TimeEdit</a></b> ( QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
 
54
<li><div class="fn"/><b><a href="q3timeedit.html#Q3TimeEdit-2">Q3TimeEdit</a></b> ( const QTime &amp; <i>time</i>, QWidget * <i>parent</i> = 0, const char * <i>name</i> = 0 )</li>
 
55
<li><div class="fn"/><b><a href="q3timeedit.html#dtor.Q3TimeEdit">~Q3TimeEdit</a></b> ()</li>
 
56
<li><div class="fn"/>bool <b><a href="q3timeedit.html#autoAdvance-prop">autoAdvance</a></b> () const</li>
 
57
<li><div class="fn"/>uint <b><a href="q3timeedit.html#display-prop">display</a></b> () const</li>
 
58
<li><div class="fn"/>QTime <b><a href="q3timeedit.html#maxValue-prop">maxValue</a></b> () const</li>
 
59
<li><div class="fn"/>QTime <b><a href="q3timeedit.html#minValue-prop">minValue</a></b> () const</li>
 
60
<li><div class="fn"/>QString <b><a href="q3timeedit.html#separator">separator</a></b> () const</li>
 
61
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#autoAdvance-prop">setAutoAdvance</a></b> ( bool <i>advance</i> )</li>
 
62
<li><div class="fn"/>void <b><a href="q3timeedit.html#display-prop">setDisplay</a></b> ( uint <i>disp</i> )</li>
 
63
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#maxValue-prop">setMaxValue</a></b> ( const QTime &amp; <i>d</i> )</li>
 
64
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#minValue-prop">setMinValue</a></b> ( const QTime &amp; <i>d</i> )</li>
 
65
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#setRange">setRange</a></b> ( const QTime &amp; <i>min</i>, const QTime &amp; <i>max</i> )</li>
 
66
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#setSeparator">setSeparator</a></b> ( const QString &amp; <i>s</i> )</li>
 
67
<li><div class="fn"/>QTime <b><a href="q3timeedit.html#time-prop">time</a></b> () const</li>
 
68
</ul>
 
69
<ul>
 
70
<li><div class="fn"/>183 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
 
71
<li><div class="fn"/>28 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
 
72
<li><div class="fn"/>10 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
73
</ul>
 
74
<a name="public-slots"></a>
 
75
<h3>Public Slots</h3>
 
76
<ul>
 
77
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#time-prop">setTime</a></b> ( const QTime &amp; <i>time</i> )</li>
 
78
</ul>
 
79
<ul>
 
80
<li><div class="fn"/>17 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
 
81
<li><div class="fn"/>1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
 
82
</ul>
 
83
<a name="signals"></a>
 
84
<h3>Signals</h3>
 
85
<ul>
 
86
<li><div class="fn"/>void <b><a href="q3timeedit.html#valueChanged">valueChanged</a></b> ( const QTime &amp; <i>time</i> )</li>
 
87
</ul>
 
88
<ul>
 
89
<li><div class="fn"/>1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
 
90
<li><div class="fn"/>1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
 
91
</ul>
 
92
<a name="protected-functions"></a>
 
93
<h3>Protected Functions</h3>
 
94
<ul>
 
95
<li><div class="fn"/>virtual QString <b><a href="q3timeedit.html#sectionFormattedText">sectionFormattedText</a></b> ( int <i>sec</i> )</li>
 
96
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#setHour">setHour</a></b> ( int <i>h</i> )</li>
 
97
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#setMinute">setMinute</a></b> ( int <i>m</i> )</li>
 
98
<li><div class="fn"/>virtual void <b><a href="q3timeedit.html#setSecond">setSecond</a></b> ( int <i>s</i> )</li>
 
99
</ul>
 
100
<ul>
 
101
<li><div class="fn"/>39 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
 
102
<li><div class="fn"/>7 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
 
103
</ul>
 
104
<h3>Additional Inherited Members</h3>
 
105
<ul>
 
106
<li><div class="fn"/>4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
 
107
<li><div class="fn"/>4 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
 
108
</ul>
 
109
<a name="details"></a>
 
110
<hr />
 
111
<h2>Detailed Description</h2>
 
112
<p>The Q3TimeEdit class provides a time editor.</p>
 
113
<p>Q3TimeEdit 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 Q3TimeEdit box. The user can automatically be moved to the next section once they complete a section using <a href="q3timeedit.html#autoAdvance-prop">setAutoAdvance</a>(). Times appear in hour, minute, second order. It is recommended that the Q3TimeEdit is initialised with a time, e.g.</p>
 
114
<pre>&nbsp;   QTime timeNow = QTime::currentTime();
 
115
    Q3TimeEdit *timeEdit = new Q3TimeEdit(timeNow, this);
 
116
    timeEdit-&gt;setRange(timeNow, timeNow.addSecs(60 * 60));</pre>
 
117
<p>Here we've created a Q3TimeEdit 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.</p>
 
118
<p>The maximum and minimum values for a time value in the time editor default to the maximum and minimum values for a <a href="qtime.html">QTime</a>. You can change this by calling <a href="q3timeedit.html#minValue-prop">setMinValue</a>(), <a href="q3timeedit.html#maxValue-prop">setMaxValue</a>() or <a href="q3timeedit.html#setRange">setRange</a>().</p>
 
119
<p>Terminology: A QTimeWidget consists of three sections, one each for the hour, minute and second. You can change the separator character using <a href="q3timeedit.html#setSeparator">setSeparator</a>(), by default the separator is read from the system's settings.</p>
 
120
<center><img src="images/datetimewidgets.png" alt="Date Time Widgets" /></center><p>See also <a href="qtime.html">QTime</a>, <a href="q3dateedit.html">Q3DateEdit</a>, and <a href="q3datetimeedit.html">Q3DateTimeEdit</a>.</p>
 
121
<hr />
 
122
<h2>Member Type Documentation</h2>
 
123
<h3 class="fn"><a name="Display-enum"></a>enum Q3TimeEdit::Display</h3>
 
124
<p>This enum defines the sections that comprise a time</p>
 
125
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
126
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
127
<tr><td valign="top"><tt>Q3TimeEdit::Hours</tt></td><td align="center" valign="top"><tt>0x01</tt></td><td valign="top">The hours section</td></tr>
 
128
<tr><td valign="top"><tt>Q3TimeEdit::Minutes</tt></td><td align="center" valign="top"><tt>0x02</tt></td><td valign="top">The minutes section</td></tr>
 
129
<tr><td valign="top"><tt>Q3TimeEdit::Seconds</tt></td><td align="center" valign="top"><tt>0x04</tt></td><td valign="top">The seconds section</td></tr>
 
130
<tr><td valign="top"><tt>Q3TimeEdit::AMPM</tt></td><td align="center" valign="top"><tt>0x10</tt></td><td valign="top">The AM/PM section</td></tr>
 
131
</table>
 
132
<p>The values can be or'ed together to show any combination.</p>
 
133
<hr />
 
134
<h2>Property Documentation</h2>
 
135
<h3 class="fn"><a name="autoAdvance-prop"></a>autoAdvance : bool</h3>
 
136
<p>This property holds whether the editor automatically advances to the next section.</p>
 
137
<p>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.</p>
 
138
<p>Access functions:</p>
 
139
<ul>
 
140
<li><div class="fn"/><b>bool autoAdvance () const</b></li>
 
141
<li><div class="fn"/><b>virtual void setAutoAdvance ( bool <i>advance</i> )</b></li>
 
142
</ul>
 
143
<h3 class="fn"><a name="display-prop"></a>display : <a href="q3timeedit.html#Display-enum">Display</a></h3>
 
144
<p>This property holds the sections that are displayed in the time edit.</p>
 
145
<p>The value can be any combination of the values in the Display enum. By default, the widget displays hours, minutes and seconds.</p>
 
146
<p>Access functions:</p>
 
147
<ul>
 
148
<li><div class="fn"/><b>uint display () const</b></li>
 
149
<li><div class="fn"/><b>void setDisplay ( uint <i>disp</i> )</b></li>
 
150
</ul>
 
151
<h3 class="fn"><a name="maxValue-prop"></a>maxValue : <a href="qtime.html">QTime</a></h3>
 
152
<p>This property holds the maximum time value.</p>
 
153
<p>Setting the maximum time value is equivalent to calling Q3TimeEdit::setRange(<a href="q3timeedit.html#minValue-prop">minValue</a>(), <i>t</i>), where <i>t</i> is the maximum time. The default maximum time is 23:59:59.</p>
 
154
<p>Access functions:</p>
 
155
<ul>
 
156
<li><div class="fn"/><b>QTime maxValue () const</b></li>
 
157
<li><div class="fn"/><b>virtual void setMaxValue ( const QTime &amp; <i>d</i> )</b></li>
 
158
</ul>
 
159
<p>See also <a href="q3timeedit.html#minValue-prop">minValue</a> and <a href="q3timeedit.html#setRange">setRange</a>().</p>
 
160
<h3 class="fn"><a name="minValue-prop"></a>minValue : <a href="qtime.html">QTime</a></h3>
 
161
<p>This property holds the minimum time value.</p>
 
162
<p>Setting the minimum time value is equivalent to calling Q3TimeEdit::setRange(<i>t</i>, <a href="q3timeedit.html#maxValue-prop">maxValue</a>()), where <i>t</i> is the minimum time. The default minimum time is 00:00:00.</p>
 
163
<p>Access functions:</p>
 
164
<ul>
 
165
<li><div class="fn"/><b>QTime minValue () const</b></li>
 
166
<li><div class="fn"/><b>virtual void setMinValue ( const QTime &amp; <i>d</i> )</b></li>
 
167
</ul>
 
168
<p>See also <a href="q3timeedit.html#maxValue-prop">maxValue</a> and <a href="q3timeedit.html#setRange">setRange</a>().</p>
 
169
<h3 class="fn"><a name="time-prop"></a>time : <a href="qtime.html">QTime</a></h3>
 
170
<p>This property holds the editor's time value.</p>
 
171
<p>When changing the time property, if the time is less than <a href="q3timeedit.html#minValue-prop">minValue</a>(), or is greater than <a href="q3timeedit.html#maxValue-prop">maxValue</a>(), nothing happens.</p>
 
172
<p>Access functions:</p>
 
173
<ul>
 
174
<li><div class="fn"/><b>QTime time () const</b></li>
 
175
<li><div class="fn"/><b>virtual void setTime ( const QTime &amp; <i>time</i> )</b></li>
 
176
</ul>
 
177
<hr />
 
178
<h2>Member Function Documentation</h2>
 
179
<h3 class="fn"><a name="Q3TimeEdit"></a>Q3TimeEdit::Q3TimeEdit ( <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
 
180
<p>Constructs an empty time edit with parent <i>parent</i> and called <i>name</i>.</p>
 
181
<h3 class="fn"><a name="Q3TimeEdit-2"></a>Q3TimeEdit::Q3TimeEdit ( const <a href="qtime.html">QTime</a> &amp; <i>time</i>, <a href="qwidget.html">QWidget</a> * <i>parent</i> = 0, const char * <i>name</i> = 0 )</h3>
 
182
<p>Constructs a time edit with the initial time value, <i>time</i>, parent <i>parent</i> and called <i>name</i>.</p>
 
183
<h3 class="fn"><a name="dtor.Q3TimeEdit"></a>Q3TimeEdit::~Q3TimeEdit ()</h3>
 
184
<p>Destroys the object and frees any allocated resources.</p>
 
185
<h3 class="fn"><a name="sectionFormattedText"></a><a href="qstring.html">QString</a> Q3TimeEdit::sectionFormattedText ( int <i>sec</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
186
<p>Returns the formatted number for section <i>sec</i>. This will correspond to either the hour, minute or second section, depending on <i>sec</i>.</p>
 
187
<p>Reimplemented from <a href="q3datetimeeditbase.html#sectionFormattedText">Q3DateTimeEditBase</a>.</p>
 
188
<h3 class="fn"><a name="separator"></a><a href="qstring.html">QString</a> Q3TimeEdit::separator () const</h3>
 
189
<p>Returns the editor's separator.</p>
 
190
<h3 class="fn"><a name="setHour"></a>void Q3TimeEdit::setHour ( int <i>h</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
191
<p>Sets the hour to <i>h</i>, which must be a valid hour, i.e. in the range 0..24.</p>
 
192
<h3 class="fn"><a name="setMinute"></a>void Q3TimeEdit::setMinute ( int <i>m</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
193
<p>Sets the minute to <i>m</i>, which must be a valid minute, i.e. in the range 0..59.</p>
 
194
<h3 class="fn"><a name="setRange"></a>void Q3TimeEdit::setRange ( const <a href="qtime.html">QTime</a> &amp; <i>min</i>, const <a href="qtime.html">QTime</a> &amp; <i>max</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
195
<p>Sets the valid input range for the editor to be from <i>min</i> to <i>max</i> inclusive. If <i>min</i> is invalid no minimum time is set. Similarly, if <i>max</i> is invalid no maximum time is set.</p>
 
196
<h3 class="fn"><a name="setSecond"></a>void Q3TimeEdit::setSecond ( int <i>s</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
197
<p>Sets the second to <i>s</i>, which must be a valid second, i.e. in the range 0..59.</p>
 
198
<h3 class="fn"><a name="setSeparator"></a>void Q3TimeEdit::setSeparator ( const <a href="qstring.html">QString</a> &amp; <i>s</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
199
<p>Sets the separator to <i>s</i>. Note that currently only the first character of <i>s</i> is used.</p>
 
200
<h3 class="fn"><a name="valueChanged"></a>void Q3TimeEdit::valueChanged ( const <a href="qtime.html">QTime</a> &amp; <i>time</i> )&nbsp;&nbsp;<tt> [signal]</tt></h3>
 
201
<p>This signal is emitted whenever the editor's value changes. The <i>time</i> parameter is the new value.</p>
 
202
<p /><address><hr /><div align="center">
 
203
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
204
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
205
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
206
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
207
</tr></table></div></address></body>
 
208
</html>