[190] | 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"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { 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 Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main 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 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
|
---|
| 35 | widget into a single widget for editing datetimes.
|
---|
| 36 | <a href="#details">More...</a>
|
---|
| 37 | <p><tt>#include <<a href="qdatetimeedit-h.html">qdatetimeedit.h</a>></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 * parent = 0, const char * name = 0 )</li>
|
---|
| 43 | <li class=fn><a href="#QDateTimeEdit-2"><b>QDateTimeEdit</b></a> ( const QDateTime & datetime, QWidget * parent = 0, const char * 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 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 QDateTime & dt )</li>
|
---|
| 54 | </ul>
|
---|
| 55 | <h2>Signals</h2>
|
---|
| 56 | <ul>
|
---|
| 57 | <li class=fn>void <a href="#valueChanged"><b>valueChanged</b></a> ( const QDateTime & datetime )</li>
|
---|
| 58 | </ul>
|
---|
| 59 | <h2>Properties</h2>
|
---|
| 60 | <ul>
|
---|
| 61 | <li class=fn>QDateTime <a href="#dateTime-prop"><b>dateTime</b></a> - the editor's datetime value</li>
|
---|
| 62 | </ul>
|
---|
| 63 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 64 |
|
---|
| 65 |
|
---|
| 66 | The QDateTimeEdit class combines a <a href="qdateedit.html">QDateEdit</a> and <a href="qtimeedit.html">QTimeEdit</a>
|
---|
| 67 | widget into a single widget for editing datetimes.
|
---|
| 68 | <p>
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | <p> QDateTimeEdit consists of a QDateEdit and QTimeEdit widget placed
|
---|
| 72 | side by side and offers the functionality of both. The user can
|
---|
| 73 | edit the date and time by using the keyboard or the arrow keys to
|
---|
| 74 | increase/decrease date or time values. The Tab key can be used to
|
---|
| 75 | move from section to section within the QDateTimeEdit widget, and
|
---|
| 76 | the user can be moved automatically when they complete a section
|
---|
| 77 | using <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
|
---|
| 80 | set 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
|
---|
| 82 | hours, minutes, seconds using the 24 hour clock.
|
---|
| 83 | <p> It is recommended that the QDateTimeEdit is initialised with a
|
---|
| 84 | datetime, e.g.
|
---|
| 85 | <pre>
|
---|
| 86 | QDateTimeEdit *dateTimeEdit = new QDateTimeEdit( QDateTime::<a href="qdatetime.html#currentDateTime">currentDateTime</a>(), this );
|
---|
| 87 | dateTimeEdit-><a href="#dateEdit">dateEdit</a>()->setRange( QDateTime::currentDate(),
|
---|
| 88 | QDateTime::currentDate().addDays( 7 ) );
|
---|
| 89 | </pre>
|
---|
| 90 |
|
---|
| 91 | Here we've created a new QDateTimeEdit set to the current date and
|
---|
| 92 | time, and set the date to have a minimum date of now and a maximum
|
---|
| 93 | date of a week from now.
|
---|
| 94 | <p> Terminology: A <a href="qdateedit.html">QDateEdit</a> widget consists of three 'sections', one
|
---|
| 95 | each for the year, month and day. Similarly a <a href="qtimeedit.html">QTimeEdit</a> consists
|
---|
| 96 | of three sections, one each for the hour, minute and second. The
|
---|
| 97 | character that separates each date section is specified with
|
---|
| 98 | setDateSeparator(); similarly setTimeSeparator() is used for the
|
---|
| 99 | time 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> * parent = 0, const char * name = 0 )
|
---|
| 105 | </h3>
|
---|
| 106 | Constructs 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 <a href="qdatetime.html">QDateTime</a> & datetime, <a href="qwidget.html">QWidget</a> * parent = 0, const char * name = 0 )
|
---|
| 110 | </h3>
|
---|
| 111 | This 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>,
|
---|
| 113 | parent <em>parent</em> and called <em>name</em>.
|
---|
| 114 |
|
---|
| 115 | <h3 class=fn><a name="~QDateTimeEdit"></a>QDateTimeEdit::~QDateTimeEdit ()
|
---|
| 116 | </h3>
|
---|
| 117 | Destroys the object and frees any allocated resources.
|
---|
| 118 |
|
---|
| 119 | <h3 class=fn>bool <a name="autoAdvance"></a>QDateTimeEdit::autoAdvance () const
|
---|
| 120 | </h3>
|
---|
| 121 | Returns 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> * <a name="dateEdit"></a>QDateTimeEdit::dateEdit ()
|
---|
| 125 | </h3>
|
---|
| 126 |
|
---|
| 127 | <p> Returns the internal widget used for editing the date part of the
|
---|
| 128 | datetime.
|
---|
| 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.
|
---|
| 132 | See the <a href="qdatetimeedit.html#dateTime-prop">"dateTime"</a> property for details.
|
---|
| 133 | <h3 class=fn>void <a name="setAutoAdvance"></a>QDateTimeEdit::setAutoAdvance ( bool advance )<tt> [virtual]</tt>
|
---|
| 134 | </h3>
|
---|
| 135 | Sets the auto advance property of the editor to <em>advance</em>. If set
|
---|
| 136 | to TRUE, the editor will automatically advance focus to the next
|
---|
| 137 | date or time section if the user has completed a section.
|
---|
| 138 |
|
---|
| 139 | <h3 class=fn>void <a name="setDateTime"></a>QDateTimeEdit::setDateTime ( const <a href="qdatetime.html">QDateTime</a> & dt )<tt> [virtual slot]</tt>
|
---|
| 140 | </h3><p>Sets the editor's datetime value to <em>dt</em>.
|
---|
| 141 | See the <a href="qdatetimeedit.html#dateTime-prop">"dateTime"</a> property for details.
|
---|
| 142 | <h3 class=fn><a href="qtimeedit.html">QTimeEdit</a> * <a name="timeEdit"></a>QDateTimeEdit::timeEdit ()
|
---|
| 143 | </h3>
|
---|
| 144 |
|
---|
| 145 | <p> Returns the internal widget used for editing the time part of the
|
---|
| 146 | datetime.
|
---|
| 147 |
|
---|
| 148 | <h3 class=fn>void <a name="valueChanged"></a>QDateTimeEdit::valueChanged ( const <a href="qdatetime.html">QDateTime</a> & 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>
|
---|
| 161 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 162 | Copyright © 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 © 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>
|
---|