⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classqextdatetimespinbox.html

📁 Linux/Windows 环境下的跨平台开发程序
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>QextDateTimeSpinBox class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.13.1 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center><hr><h1>QextDateTimeSpinBox  Class Reference</h1>Flexible date and time selection spinbox, similar to the MFC COleDateTimeCtrl widget. QextDateTimeSpinBox is a QDate/QTime-based date and/or time selection spinbox control. It allows very flexible alteration of the format in which the information is displayed. Full multi-language support is planned for a future release. <a href="#_details">More...</a><p><code>#include &lt;<a class="el" href="qextdatetimespinbox_8h-source.html">qextdatetimespinbox.h</a>&gt;</code><p><a href="classQextDateTimeSpinBox-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Slots</h2></td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#g0">onEditTextChanged</a> (const QString &amp;)</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#g1">onFormatChanged</a> (const QString &amp;)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#g2">setDate</a> (const QDate &amp;)</td></tr><tr><td nowrap align=right valign=top><a name="g3" doxytag="QextDateTimeSpinBox::setFormat"></a>void&nbsp;</td><td valign=bottom><b>setFormat</b> (const QString &amp;)</td></tr><tr><td nowrap align=right valign=top><a name="g4" doxytag="QextDateTimeSpinBox::setStrings"></a>void&nbsp;</td><td valign=bottom><b>setStrings</b> (const QStringList &amp;, const QStringList &amp;)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#g5">setTime</a> (const QTime &amp;)</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#g6">stepDown</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#g7">stepUp</a> ()</td></tr><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a0">QextDateTimeSpinBox</a> (QWidget *parent=NULL, const char *name=NULL, const QString *format=NULL, const QDate *date=NULL, const QTime *time=NULL, const QStringList *days=NULL, const QStringList *months=NULL)</td></tr><tr><td nowrap align=right valign=top>virtual&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a1">~QextDateTimeSpinBox</a> ()</td></tr><tr><td nowrap align=right valign=top>QDate&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a2">date</a> (void) const</td></tr><tr><td nowrap align=right valign=top><a name="a3" doxytag="QextDateTimeSpinBox::fieldFromIndex"></a>QextDateTimeValidator::Token <br>const *&nbsp;</td><td valign=bottom><b>fieldFromIndex</b> (int)</td></tr><tr><td nowrap align=right valign=top><a name="a4" doxytag="QextDateTimeSpinBox::format"></a>QString&nbsp;</td><td valign=bottom><b>format</b> (void) const</td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a5">indexFromField</a> (QextDateTimeValidator::Token const *)</td></tr><tr><td nowrap align=right valign=top><a name="a6" doxytag="QextDateTimeSpinBox::mapTextToValue"></a>virtual int&nbsp;</td><td valign=bottom><b>mapTextToValue</b> (bool *)</td></tr><tr><td nowrap align=right valign=top>virtual QString&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a7">mapValueToText</a> (int)</td></tr><tr><td nowrap align=right valign=top>QTime&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a8">time</a> (void) const</td></tr><tr><td nowrap align=right valign=top><a class="el" href="classQextDateTimeValidator.html">QextDateTimeValidator</a> *&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#a9">validator</a> (void) const</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b0">fieldSize</a> (QextDateTimeValidator::Token const *) const</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b1">refresh</a> ()</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b2">setDefaultStrings</a> (void)</td></tr><tr><td nowrap align=right valign=top>virtual void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b3">updateDisplay</a> ()</td></tr><tr><td nowrap align=right valign=top>QString&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b4">longMonthName</a> (int) const</td></tr><tr><td nowrap align=right valign=top>QString&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b5">longDayName</a> (int) const</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b6">setLongMonthNames</a> (const QStringList &amp;)</td></tr><tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classQextDateTimeSpinBox.html#b7">setLongDayNames</a> (const QStringList &amp;)</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a name="n0" doxytag="QextDateTimeSpinBox::Date"></a>QDate&nbsp;</td><td valign=bottom><b>Date</b></td></tr><tr><td nowrap align=right valign=top><a name="n1" doxytag="QextDateTimeSpinBox::Time"></a>QTime&nbsp;</td><td valign=bottom><b>Time</b></td></tr><tr><td nowrap align=right valign=top><a name="n2" doxytag="QextDateTimeSpinBox::Format"></a>QString&nbsp;</td><td valign=bottom><b>Format</b></td></tr><tr><td nowrap align=right valign=top><a name="n3" doxytag="QextDateTimeSpinBox::Validator"></a><a class="el" href="classQextDateTimeValidator.html">QextDateTimeValidator</a> *&nbsp;</td><td valign=bottom><b>Validator</b></td></tr><tr><td nowrap align=right valign=top><a name="n4" doxytag="QextDateTimeSpinBox::CursorPos"></a>int&nbsp;</td><td valign=bottom><b>CursorPos</b></td></tr><tr><td nowrap align=right valign=top><a name="n5" doxytag="QextDateTimeSpinBox::monthNames"></a>QString&nbsp;</td><td valign=bottom><b>monthNames</b> [12]</td></tr><tr><td nowrap align=right valign=top><a name="n6" doxytag="QextDateTimeSpinBox::dayNames"></a>QString&nbsp;</td><td valign=bottom><b>dayNames</b> [7]</td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Flexible date and time selection spinbox, similar to the MFC COleDateTimeCtrl widget. QextDateTimeSpinBox is a QDate/QTime-based date and/or time selection spinbox control. It allows very flexible alteration of the format in which the information is displayed. Full multi-language support is planned for a future release.<p><dl compact><dt><b>Version: </b><dd>1.0 </dl><dl compact><dt><b>Author: </b><dd>Wayne Roth (<a href="mailto:wroth@speakeasy.org">wroth@speakeasy.org</a>) </dl><p><hr><h2>Constructor &amp; Destructor Documentation</h2><a name="a0" doxytag="QextDateTimeSpinBox::QextDateTimeSpinBox"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> QextDateTimeSpinBox::QextDateTimeSpinBox </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">QWidget *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>parent</em> = NULL, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>name</em> = NULL, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const QString *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>format</em> = NULL, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const QDate *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>date</em> = NULL, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const QTime *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>time</em> = NULL, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const QStringList *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>days</em> = NULL, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const QStringList *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>months</em> = NULL</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Constructs a QextDateTimeSpinBox with date given by the date argument and time given by the  time argument. The control will use the strings provided in the days and months QString arrays.  The date and time will be formatted as specified in the format argument, using the following  format specifiers:<p><div class="fragment"><pre>%A  uppercase AM/PM indicator ("AM" or "PM")%a  lowercase AM/PM indicator ("am" or "pm")%d  Day (1-31, depending on the current month)%H  Hour, on a 24-hour clock (0-23)%h  Hour, on a 12-hour clock (1-12)%M  Month (1-12)%m  Month String ("January", "February", etc.)%n  Minute (0-59)%s  Second (0-59)%w  Day of the week ("Sunday", "Monday", etc.)%Y  4-digit year (1752-8000)%y  2-digit year (0-99)</pre></div><p>The specifiers can also be modified with integers - for example %3w will print the first 3 letters of the day of the week ("Sun", "Mon", etc.).<p>A 0 in a specifier indicates that leading zeros will be added where applicable. For example %0M  will represent January as "01". A zero in a non-integer specifier indicates right-alignment.  For example %0m will represent May as " May". Note the leading spaces. The length of the  field will be specified by the longest string in the Months member array.<p>If for example we want the format to be 17:52:07 Tue 27 Feb 2010, the widget would be created like this:<p><div class="fragment"><pre>QString format(<font class="stringliteral">"%0H:%n:%s %3w %d %3m %Y"</font>);<a class="code" href="classQextDateTimeSpinBox.html">QextDateTimeSpinBox</a>* DateTime=<font class="keyword">new</font> <a class="code" href="classQextDateTimeSpinBox.html#a0">QextDateTimeSpinBox</a>(&amp;format);</pre></div><p>If the date or time arguments are NULL or unspecified, the widget will use the current date or  time as returned by QDate::currentDate() or QTime::currentTime(). If the daysor months  structures are NULL or unspecified, the default day and/or month names will be used.     </td>  </tr></table><a name="a1" doxytag="QextDateTimeSpinBox::~QextDateTimeSpinBox"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> QextDateTimeSpinBox::~QextDateTimeSpinBox </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Standard destructor.     </td>  </tr></table><hr><h2>Member Function Documentation</h2><a name="a2" doxytag="QextDateTimeSpinBox::date"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> QDate QextDateTimeSpinBox::date </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const</td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Returns the most recent valid date entered into the control.     </td>  </tr></table><a name="b0" doxytag="QextDateTimeSpinBox::fieldSize"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> int QextDateTimeSpinBox::fieldSize </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">QextDateTimeValidator::Token const *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>Field</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>returns the length of the token represented by Field. Used internally.     </td>  </tr></table><a name="a5" doxytag="QextDateTimeSpinBox::indexFromField"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> int QextDateTimeSpinBox::indexFromField </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">QextDateTimeValidator::Token const *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>field</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>returns the starting offset of the field represented by the QextDateTimeValidator::Token  pointer in the editor.     </td>  </tr></table><a name="b5" doxytag="QextDateTimeSpinBox::longDayName"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> QString QextDateTimeSpinBox::longDayName </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>dayNum</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>returns the day name for the day of the week specified. By default longDayName(1) will return  "Monday", etc. Note that this is different from the American week which starts with Sunday. This is to maintain consistency with the QT 3.0 function QDate::longDayName().     </td>  </tr></table><a name="b4" doxytag="QextDateTimeSpinBox::longMonthName"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> QString QextDateTimeSpinBox::longMonthName </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>monthNum</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap> const<code> [protected]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>returns the month name for the month specified. By default, longMonthName(1) will return  "January", etc.     </td>  </tr></table><a name="a7" doxytag="QextDateTimeSpinBox::mapValueToText"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> QString QextDateTimeSpinBox::mapValueToText </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Trivial override of the default QSpinBox behavior - text does not map directly to a value in this  case.     </td>  </tr></table><a name="g0" doxytag="QextDateTimeSpinBox::onEditTextChanged"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -