source: trunk/doc/html/qdatetimeedit.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 8.7 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qdatetimeedit.cpp:2599 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QDateTimeEdit Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QDateTimeEdit Class Reference</h1>
33
34<p>The QDateTimeEdit class combines a QDateEdit and QTimeEdit
35widget into a single widget for editing datetimes.
36<a href="#details">More...</a>
37<p><tt>#include &lt;<a href="qdatetimeedit-h.html">qdatetimeedit.h</a>&gt;</tt>
38<p>Inherits <a href="qwidget.html">QWidget</a>.
39<p><a href="qdatetimeedit-members.html">List of all member functions.</a>
40<h2>Public Members</h2>
41<ul>
42<li class=fn><a href="#QDateTimeEdit"><b>QDateTimeEdit</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
43<li class=fn><a href="#QDateTimeEdit-2"><b>QDateTimeEdit</b></a> ( const&nbsp;QDateTime&nbsp;&amp;&nbsp;datetime, QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
44<li class=fn><a href="#~QDateTimeEdit"><b>~QDateTimeEdit</b></a> ()</li>
45<li class=fn>QDateTime <a href="#dateTime"><b>dateTime</b></a> () const</li>
46<li class=fn>QDateEdit * <a href="#dateEdit"><b>dateEdit</b></a> ()</li>
47<li class=fn>QTimeEdit * <a href="#timeEdit"><b>timeEdit</b></a> ()</li>
48<li class=fn>virtual void <a href="#setAutoAdvance"><b>setAutoAdvance</b></a> ( bool&nbsp;advance )</li>
49<li class=fn>bool <a href="#autoAdvance"><b>autoAdvance</b></a> () const</li>
50</ul>
51<h2>Public Slots</h2>
52<ul>
53<li class=fn>virtual void <a href="#setDateTime"><b>setDateTime</b></a> ( const&nbsp;QDateTime&nbsp;&amp;&nbsp;dt )</li>
54</ul>
55<h2>Signals</h2>
56<ul>
57<li class=fn>void <a href="#valueChanged"><b>valueChanged</b></a> ( const&nbsp;QDateTime&nbsp;&amp;&nbsp;datetime )</li>
58</ul>
59<h2>Properties</h2>
60<ul>
61<li class=fn>QDateTime <a href="#dateTime-prop"><b>dateTime</b></a>&nbsp;- the editor's datetime value</li>
62</ul>
63<hr><a name="details"></a><h2>Detailed Description</h2>
64
65
66The QDateTimeEdit class combines a <a href="qdateedit.html">QDateEdit</a> and <a href="qtimeedit.html">QTimeEdit</a>
67widget into a single widget for editing datetimes.
68<p>
69
70
71<p> QDateTimeEdit consists of a QDateEdit and QTimeEdit widget placed
72side by side and offers the functionality of both. The user can
73edit the date and time by using the keyboard or the arrow keys to
74increase/decrease date or time values. The Tab key can be used to
75move from section to section within the QDateTimeEdit widget, and
76the user can be moved automatically when they complete a section
77using <a href="#setAutoAdvance">setAutoAdvance</a>(). The datetime can be set with
78<a href="#setDateTime">setDateTime</a>().
79<p> The date format is read from the system's locale settings. It is
80set to year, month, day order if that is not possible. See
81<a href="qdateedit.html#setOrder">QDateEdit::setOrder</a>() to change this. Times appear in the order
82hours, minutes, seconds using the 24 hour clock.
83<p> It is recommended that the QDateTimeEdit is initialised with a
84datetime, e.g.
85<pre>
86 QDateTimeEdit *dateTimeEdit = new QDateTimeEdit( QDateTime::<a href="qdatetime.html#currentDateTime">currentDateTime</a>(), this );
87 dateTimeEdit-&gt;<a href="#dateEdit">dateEdit</a>()-&gt;setRange( QDateTime::currentDate(),
88 QDateTime::currentDate().addDays( 7 ) );
89 </pre>
90
91Here we've created a new QDateTimeEdit set to the current date and
92time, and set the date to have a minimum date of now and a maximum
93date of a week from now.
94<p> Terminology: A <a href="qdateedit.html">QDateEdit</a> widget consists of three 'sections', one
95each for the year, month and day. Similarly a <a href="qtimeedit.html">QTimeEdit</a> consists
96of three sections, one each for the hour, minute and second. The
97character that separates each date section is specified with
98setDateSeparator(); similarly setTimeSeparator() is used for the
99time sections.
100<p> <center><img src="datetimewidgets.png" alt="Date Time Widgets"></center>
101<p> <p>See also <a href="qdateedit.html">QDateEdit</a>, <a href="qtimeedit.html">QTimeEdit</a>, <a href="advanced.html">Advanced Widgets</a>, and <a href="time.html">Time and Date</a>.
102
103<hr><h2>Member Function Documentation</h2>
104<h3 class=fn><a name="QDateTimeEdit"></a>QDateTimeEdit::QDateTimeEdit ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
105</h3>
106Constructs an empty datetime edit with parent <em>parent</em> and called
107<em>name</em>.
108
109<h3 class=fn><a name="QDateTimeEdit-2"></a>QDateTimeEdit::QDateTimeEdit ( const&nbsp;<a href="qdatetime.html">QDateTime</a>&nbsp;&amp;&nbsp;datetime, <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
110</h3>
111This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
112<p> Constructs a datetime edit with the initial value <em>datetime</em>,
113parent <em>parent</em> and called <em>name</em>.
114
115<h3 class=fn><a name="~QDateTimeEdit"></a>QDateTimeEdit::~QDateTimeEdit ()
116</h3>
117Destroys the object and frees any allocated resources.
118
119<h3 class=fn>bool <a name="autoAdvance"></a>QDateTimeEdit::autoAdvance () const
120</h3>
121Returns TRUE if auto-advance is enabled, otherwise returns FALSE.
122<p> <p>See also <a href="#setAutoAdvance">setAutoAdvance</a>().
123
124<h3 class=fn><a href="qdateedit.html">QDateEdit</a>&nbsp;* <a name="dateEdit"></a>QDateTimeEdit::dateEdit ()
125</h3>
126
127<p> Returns the internal widget used for editing the date part of the
128datetime.
129
130<h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="dateTime"></a>QDateTimeEdit::dateTime () const
131</h3><p>Returns the editor's datetime value.
132See the <a href="qdatetimeedit.html#dateTime-prop">"dateTime"</a> property for details.
133<h3 class=fn>void <a name="setAutoAdvance"></a>QDateTimeEdit::setAutoAdvance ( bool&nbsp;advance )<tt> [virtual]</tt>
134</h3>
135Sets the auto advance property of the editor to <em>advance</em>. If set
136to TRUE, the editor will automatically advance focus to the next
137date or time section if the user has completed a section.
138
139<h3 class=fn>void <a name="setDateTime"></a>QDateTimeEdit::setDateTime ( const&nbsp;<a href="qdatetime.html">QDateTime</a>&nbsp;&amp;&nbsp;dt )<tt> [virtual slot]</tt>
140</h3><p>Sets the editor's datetime value to <em>dt</em>.
141See the <a href="qdatetimeedit.html#dateTime-prop">"dateTime"</a> property for details.
142<h3 class=fn><a href="qtimeedit.html">QTimeEdit</a>&nbsp;* <a name="timeEdit"></a>QDateTimeEdit::timeEdit ()
143</h3>
144
145<p> Returns the internal widget used for editing the time part of the
146datetime.
147
148<h3 class=fn>void <a name="valueChanged"></a>QDateTimeEdit::valueChanged ( const&nbsp;<a href="qdatetime.html">QDateTime</a>&nbsp;&amp;&nbsp;datetime )<tt> [signal]</tt>
149</h3>
150
151<p> This signal is emitted every time the date or time changes. The <em>datetime</em> argument is the new datetime.
152
153<hr><h2>Property Documentation</h2>
154<h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="dateTime-prop"></a>dateTime</h3>
155<p>This property holds the editor's datetime value.
156<p>The datetime edit's datetime which may be an invalid datetime.
157
158<p>Set this property's value with <a href="#setDateTime">setDateTime</a>() and get this property's value with <a href="#dateTime">dateTime</a>().
159<!-- eof -->
160<hr><p>
161This file is part of the <a href="index.html">Qt toolkit</a>.
162Copyright &copy; 1995-2007
163<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
164<table width=100% cellspacing=0 border=0><tr>
165<td>Copyright &copy; 2007
166<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
167<td align=right><div align=right>Qt 3.3.8</div>
168</table></div></address></body>
169</html>
Note: See TracBrowser for help on using the repository browser.