?? qdatetimeedit.html
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/widgets/qdatetimeedit.cpp:2311 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QDateTimeEdit Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td valign=center> <a href="index.html"><font color="#004faf">Home</font></a> | <a href="classes.html"><font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><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><p>The QDateTimeEdit class combines a QDateEdit and QTimeEditwidget into a single widget for editing datetimes.<a href="#details">More...</a><p><tt>#include <<a href="qdatetimeedit-h.html">qdatetimeedit.h</a>></tt><p>Inherits <a href="qwidget.html">QWidget</a>.<p><a href="qdatetimeedit-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QDateTimeEdit"><b>QDateTimeEdit</b></a> ( QWidget * parent = 0, const char * name = 0 )</div></li><li><div class=fn><a href="#QDateTimeEdit-2"><b>QDateTimeEdit</b></a> ( const QDateTime & datetime, QWidget * parent = 0, const char * name = 0 )</div></li><li><div class=fn><a href="#~QDateTimeEdit"><b>~QDateTimeEdit</b></a> ()</div></li><li><div class=fn>virtual void <a href="#setDateTime"><b>setDateTime</b></a> ( const QDateTime & dt )</div></li><li><div class=fn>QDateTime <a href="#dateTime"><b>dateTime</b></a> () const</div></li><li><div class=fn>QDateEdit * <a href="#dateEdit"><b>dateEdit</b></a> ()</div></li><li><div class=fn>QTimeEdit * <a href="#timeEdit"><b>timeEdit</b></a> ()</div></li><li><div class=fn>virtual void <a href="#setAutoAdvance"><b>setAutoAdvance</b></a> ( bool advance )</div></li><li><div class=fn>bool <a href="#autoAdvance"><b>autoAdvance</b></a> () const</div></li></ul><h2>Signals</h2><ul><li><div class=fn>void <a href="#valueChanged"><b>valueChanged</b></a> ( const QDateTime & datetime )</div></li></ul><h2>Properties</h2><ul><li><div class=fn>QDateTime <a href="#dateTime-prop"><b>dateTime</b></a> - the datetime value of the editor</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2><p> The QDateTimeEdit class combines a <a href="qdateedit.html">QDateEdit</a> and <a href="qtimeedit.html">QTimeEdit</a>widget into a single widget for editing datetimes.<p> QDateTimeEdit consists of a QDateEdit and QTimeEdit widget placedside by side and offers the functionality of both. The user can editthe date and time by using the keyboard or the arrow keys toincrease/decrease date or time values. The Tab key can be used tomove from section to section within the QDateTimeEdit widget, and theuser can be moved automatically when they complete a section using<a href="#setAutoAdvance">setAutoAdvance</a>(). The datetime can be set with <a href="#setDateTime">setDateTime</a>().<p> The dateformat is read from the system's locale settings. It is set toyear, month, day order if that is not possible. see <a href="qdateedit.html#setOrder">QDateEdit::setOrder</a>()to change this. Times appear in the order hours, minutes, secondsusing the 24 hour clock.<p> It is recommended that the QDateTimeEdit is initialised with adatetime, e.g.<pre> QDateTimeEdit *dateTimeEdit = new QDateTimeEdit( QDateTime::<a href="qdatetime.html#currentDateTime">currentDateTime</a>(), this ); dateTimeEdit-><a href="#dateEdit">dateEdit</a>()->setRange( QDateTime::currentDate(), QDateTime::currentDate().addDays( 7 ) ); </pre> Here we've created a new QDateTimeEdit set to the current date andtime, and set the date to have a minimum date of now and a maximumdate of a week from now.<p> Terminology: A <a href="qdateedit.html">QDateEdit</a> widget consists of three 'sections', one eachfor the year, month and day. Similarly a <a href="qtimeedit.html">QTimeEdit</a> consists of threesections, one each for the hour, minute and second. The character thatseparates each date section is specified with setDateSeparator();similarly setTimeSeparator() is used for the time sections.<p> <center><img src="datetimewidgets.png" alt="Date Time Widgets"></center> <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>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QDateTimeEdit"></a>QDateTimeEdit::QDateTimeEdit ( <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )</h3> Constructs an empty datetime edit with parent <em>parent</em> and name<em>name</em>.<p> <h3 class=fn><a name="QDateTimeEdit-2"></a>QDateTimeEdit::QDateTimeEdit ( const <a href="qdatetime.html">QDateTime</a> & datetime, <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Constructs a datetime edit with the initial value <em>datetime</em>, parent<em>parent</em> and name <em>name</em>.<p> <h3 class=fn><a name="~QDateTimeEdit"></a>QDateTimeEdit::~QDateTimeEdit ()</h3> Destroys the object and frees any allocated resources.<p> <h3 class=fn>bool <a name="autoAdvance"></a>QDateTimeEdit::autoAdvance () const</h3> Returns TRUE if auto-advance is enabled, otherwise returns FALSE.<p> <p>See also <a href="#setAutoAdvance">setAutoAdvance</a>().<p> <h3 class=fn><a href="qdateedit.html">QDateEdit</a> * <a name="dateEdit"></a>QDateTimeEdit::dateEdit ()</h3> Returns the internal widget used for editing the date part of the datetime.<h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="dateTime"></a>QDateTimeEdit::dateTime () const</h3><p>Returns the datetime value of the editor.See the <a href="qdatetimeedit.html#dateTime-prop">"dateTime"</a> property for details.<h3 class=fn>void <a name="setAutoAdvance"></a>QDateTimeEdit::setAutoAdvance ( bool advance )<tt> [virtual]</tt></h3> Sets the auto advance property of the editor to <em>advance</em>. Ifset to TRUE, the editor will automatically advance focus to the nextdate or time section if the user has completed a section.<p> <h3 class=fn>void <a name="setDateTime"></a>QDateTimeEdit::setDateTime ( const <a href="qdatetime.html">QDateTime</a> & dt )<tt> [virtual]</tt></h3><p>Sets the datetime value of the editor to <em>dt</em>.See the <a href="qdatetimeedit.html#dateTime-prop">"dateTime"</a> property for details.<h3 class=fn><a href="qtimeedit.html">QTimeEdit</a> * <a name="timeEdit"></a>QDateTimeEdit::timeEdit ()</h3> Returns the internal widget used for editing the time part of the datetime.<h3 class=fn>void <a name="valueChanged"></a>QDateTimeEdit::valueChanged ( const <a href="qdatetime.html">QDateTime</a> & datetime )<tt> [signal]</tt></h3> <p> This signal is emitted every time the date or time changes. The<em>datetime</em> argument is the new datetime.<hr><h2>Property Documentation</h2><h3 class=fn><a href="qdatetime.html">QDateTime</a> <a name="dateTime-prop"></a>dateTime</h3> <p>This property holds the datetime value of the editor.<p>The datetime edit's datetime which may be an invaliddatetime.<p>Set this property's value with <a href="#setDateTime">setDateTime</a>() and get this property's value with <a href="#dateTime">dateTime</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright © 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright © 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -