<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # QTime Class Reference ## [[QtCore](index.htm) module] 該QTIME類提供時鐘時間的功能。[More...](#details) ### Methods * `__init__ (self)` * `__init__ (self, int?h, int?m, int?second?=?0, int?msec?=?0)` * `__init__ (self, QTime)` * `QTime addMSecs (self, int?ms)` * `QTime addSecs (self, int?secs)` * `int elapsed (self)` * `int hour (self)` * `bool isNull (self)` * `bool isValid (self)` * `int minute (self)` * `int msec (self)` * `int msecsTo (self, QTime)` * `int restart (self)` * `int second (self)` * `int secsTo (self, QTime)` * `bool setHMS (self, int?h, int?m, int?s, int?msec?=?0)` * `start (self)` * `datetime.time toPyTime (self)` * `QString toString (self, Qt.DateFormat?format?=?Qt.TextDate)` * `QString toString (self, QString?format)` ### Static Methods * `QTime currentTime ()` * `QTime fromString (QString?string, Qt.DateFormat?format?=?Qt.TextDate)` * `QTime fromString (QString?s, QString?format)` * `bool isValid (int?h, int?m, int?s, int?msec?=?0)` ### Special Methods * `int __bool__ (self)` * `bool __eq__ (self, QTime?other)` * `bool __ge__ (self, QTime?other)` * `bool __gt__ (self, QTime?other)` * `int __hash__ (self)` * `bool __le__ (self, QTime?other)` * `bool __lt__ (self, QTime?other)` * `bool __ne__ (self, QTime?other)` * `str __repr__ (self)` * * * ## Detailed Description 這個類可以醃制。 也可以使用一個Python的datetime對象,每當一個[QTime](qtime.html)預計。 該QTIME類提供時鐘時間的功能。 一個QTIME對象包含一個時鐘時間,即小時,分鐘,秒和毫秒自午夜數。它可以從系統時鐘讀取當前時間,并測量經過的時間跨度。它提供的功能,用于比較時間和用于通過將一個數毫秒的操作時間。 QTIME使用24小時時鐘格式,它具有AM / PM的概念。不像[QDateTime](qdatetime.html), QTIME一無所知時區或日光節約時間(DST ) 。 一個QTIME對象通常是通過給小時,分鐘,秒和毫秒數顯式,或使用靜態函數創建[currentTime](qtime.html#currentTime)( ) ,它會創建一個包含系統的本地時間QTIME對象。請注意,精度依賴于底層操作系統的準確性;不是所有的系統都提供1毫秒的精度。 該[hour](qtime.html#hour)( )[minute](qtime.html#minute)( )[second](qtime.html#second)()和[msec](qtime.html#msec)( )函數可以訪問的時,分,秒和時間的毫秒數。相同的信息被提供以文本格式[toString](qtime.html#toString)()函數。 QTIME提供了一整套的運營商來比較兩個QTIME對象。一時間被認為比另一個更小,如果它是早于其他。 的時間的秒或毫秒的給定數量超過一個給定的時間可以用找到的[addSecs](qtime.html#addSecs)()或[addMSecs](qtime.html#addMSecs)()函數。與此相對應,幾秒鐘或兩個時間之間的毫秒數可以使用被發現[secsTo](qtime.html#secsTo)()或[msecsTo](qtime.html#msecsTo)( ) 。 QTIME可用于使用測量的經過時間跨度的[start](qtime.html#start)( )[restart](qtime.html#restart)()和[elapsed](qtime.html#elapsed)()函數。 * * * ## Method Documentation ``` QTime.__init__ (self) ``` 構造一個空的時間對象。空時間可[QTime](qtime.html)(0,0 ,0,0 )(即,午夜)對象,不同的是[isNull](qtime.html#isNull)( )返回True,[isValid](qtime.html#isValid)( )返回False 。 **See also** [isNull](qtime.html#isNull)()和[isValid](qtime.html#isValid)( ) 。 ``` QTime.__init__ (self, int?h, int?m, int?second?=?0, int?msec?=?0) ``` 構造一個時間小時_h_,分_m_,秒_s_和毫秒_ms_。 _h_必須在范圍0?23,_m_和_s_必須在范圍0 ?59,_ms_必須在范圍0到999 。 **See also** [isValid](qtime.html#isValid)( ) 。 ``` QTime.__init__ (self, QTime) ``` ``` QTime QTime.addMSecs (self, int?ms) ``` [](qtime.html) [返回](qtime.html)[QTime](qtime.html)對象包含時間_ms_毫秒遲于該對象的時間(或更早版本,如果_ms_是負的) 。 需要注意的是,如果它通過午夜的時候會換行。看[addSecs](qtime.html#addSecs)( )的一個例子。 **See also** [addSecs](qtime.html#addSecs)( )[msecsTo](qtime.html#msecsTo)()和[QDateTime.addMSecs](qdatetime.html#addMSecs)( ) 。 ``` QTime QTime.addSecs (self, int?secs) ``` [](qtime.html) [返回](qtime.html)[QTime](qtime.html)對象包含時間_s_秒遲于該對象的時間(或更早版本,如果_s_是負的) 。 需要注意的是,如果它通過午夜的時候會換行。 例如: ``` [QTime](qtime.html) n(14, 0, 0); // n == 14:00:00 [QTime](qtime.html) t; t = n.addSecs(70); // t == 14:01:10 t = n.addSecs(-70); // t == 13:58:50 t = n.addSecs(10 * 60 * 60 + 5); // t == 00:00:05 t = n.addSecs(-15 * 60 * 60); // t == 23:00:00 ``` **See also** [addMSecs](qtime.html#addMSecs)( )[secsTo](qtime.html#secsTo)()和[QDateTime.addSecs](qdatetime.html#addSecs)( ) 。 ``` QTime QTime.currentTime () ``` [ 返回當前時間所報告的系統時鐘。 請注意,精度依賴于底層操作系統的準確性;不是所有的系統都提供1毫秒的精度。 ``` int QTime.elapsed (self) ``` ](qtime.html) [返回自上一次已經過的毫秒數](qtime.html)[start](qtime.html#start)()或[restart](qtime.html#restart)( )被調用。 請注意,計數器回到零24小時內的最后一次通話后,[start](qtime.html#start)()或重啟。 請注意,精度依賴于底層操作系統的準確性;不是所有的系統都提供1毫秒的精度。 **Warning:**如果系統的時鐘設置已自最后一次修改[start](qtime.html#start)()或[restart](qtime.html#restart)( )被調用,結果是不確定的。日光節約時間開啟或關閉可能發生這種情況。 **See also** [start](qtime.html#start)()和[restart](qtime.html#restart)( ) 。 ``` QTime QTime.fromString (QString?string, Qt.DateFormat?format?=?Qt.TextDate) ``` [](qtime.html) [傳回所代表的時間_string_作為](qtime.html)[QTime](qtime.html)使用_format_給予,或無效的時間,如果這是不可能的。 需要注意的是fromString ( )使用“ C”語言環境編碼的字符串,以毫秒為單位轉換為float值。如果默認locale是不是“ C” ,這可能會導致兩個轉換的嘗試(如果轉換失敗的默認語言環境) 。這應該被視為一個實現細節。 ``` QTime QTime.fromString (QString?s, QString?format) ``` [](qtime.html) [返回](qtime.html)[QTime](qtime.html)由表示_string_使用_format_給予,或者如果字符串不能解析一個無效的時間。 這些表達式可以用于格式: | Expression | Output | | --- | --- | | h | the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display) | | hh | the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display) | | m | the minute without a leading zero (0 to 59) | | mm | the minute with a leading zero (00 to 59) | | s | the second without a leading zero (0 to 59) | | ss | the second with a leading zero (00 to 59) | | z | the milliseconds without leading zeroes (0 to 999) | | zzz | the milliseconds with leading zeroes (000 to 999) | | AP | interpret as an AM/PM time. _AP_ must be either "AM" or "PM". | | ap | Interpret as an AM/PM time. _ap_ must be either "am" or "pm". | 所有其他輸入的字符將被視為文本。括在單引號中的任何字符序列也將被視為文本,而不是作為一個表達式。 ``` [QTime](qtime.html) time = [QTime](qtime.html).fromString("1mm12car00", "m'mm'hcarss"); // time is 12:01.00 ``` 如果該格式不被滿足的無效[QTime](qtime.html)返回。不指望前導零應給予(H , M,S和z )表達式是貪婪的。這意味著它們將使用兩個數字,即使這使他們接受的值的范圍外,葉太少位數為其他部分。例如,下面的字符串可能意味著0時07分10秒,但米將抓住兩個數字,從而導致無效時間: ``` [QTime](qtime.html) time = [QTime](qtime.html).fromString("00:710", "hh:ms"); // invalid ``` 未在該格式表示的任何字段將被設置為零。例如: ``` [QTime](qtime.html) time = [QTime](qtime.html).fromString("1.30", "m.s"); // time is 00:01:30.000 ``` [QDateTime.toString](qdatetime.html#toString)( )[QTime.toString](qtime.html#toString)( ) **See also** [QDateTime.fromString](qdatetime.html#fromString)( )[QDate.fromString](qdate.html#fromString)()和[QDate.toString](qdate.html#toString)( ) 。 ``` int QTime.hour (self) ``` 返回時間的小時部分( 0到23) 。 **See also** [minute](qtime.html#minute)( )[second](qtime.html#second)()和[msec](qtime.html#msec)( ) 。 ``` bool QTime.isNull (self) ``` 返回True如果時間為null (即,[QTime](qtime.html)使用默認構造函數)構造分布,否則返回False 。一個空的時間也是無效的時間。 **See also** [isValid](qtime.html#isValid)( ) 。 ``` bool QTime.isValid (self) ``` 返回True如果時間是有效的,否則返回False 。例如,時間23:30:55.746是有效的,但24:12:30是無效的。 **See also** [isNull](qtime.html#isNull)( ) 。 ``` bool QTime.isValid (int?h, int?m, int?s, int?msec?=?0) ``` 這是一個重載函數。 返回True如果指定的時間是有效的,否則返回False 。 時間是有效的,如果_h_取值范圍為0?23,_m_和_s_的范圍是0 ?59,_ms_的范圍是從0到999 。 例如: ``` [QTime](qtime.html).isValid(21, 10, 30); // returns true [QTime](qtime.html).isValid(22, 5, 62); // returns false ``` ``` int QTime.minute (self) ``` 返回時間的分鐘部分( 0到59) 。 **See also** [hour](qtime.html#hour)( )[second](qtime.html#second)()和[msec](qtime.html#msec)( ) 。 ``` int QTime.msec (self) ``` 返回時間的毫秒部分( 0到999 ) 。 **See also** [hour](qtime.html#hour)( )[minute](qtime.html#minute)()和[second](qtime.html#second)( ) 。 ``` int QTime.msecsTo (self, QTime) ``` 返回的毫秒數從這個時候_t_。如果_t_早于當前時間,返回的毫秒數是負的。 因為[QTime](qtime.html)測量時間在一天之內,并有86400秒,一天的結果總是之間-86400000和86400000毫秒。 **See also** [secsTo](qtime.html#secsTo)( )[addMSecs](qtime.html#addMSecs)()和[QDateTime.msecsTo](qdatetime.html#msecsTo)( ) 。 ``` int QTime.restart (self) ``` 設置此時間為當前時間,并返回自上一次已經過的毫秒數[start](qtime.html#start)( )或重新啟動()被調用。 此功能保證是原子的,因此是非常方便的重復測量。通話[start](qtime.html#start)( ) ,開始第一次測量,并重新啟動( )為每個后來的測量。 請注意,計數器回到零24小時內的最后一次通話后,[start](qtime.html#start)( )或重新啟動( ) 。 **Warning:**如果系統的時鐘設置已自最后一次修改[start](qtime.html#start)( )或重新啟動( )被調用,結果是不確定的。日光節約時間開啟或關閉可能發生這種情況。 **See also** [start](qtime.html#start)( )[elapsed](qtime.html#elapsed)()和[currentTime](qtime.html#currentTime)( ) 。 ``` int QTime.second (self) ``` 返回的時間的第二部分(0到59)。 **See also** [hour](qtime.html#hour)( )[minute](qtime.html#minute)()和[msec](qtime.html#msec)( ) 。 ``` int QTime.secsTo (self, QTime) ``` 返回的秒數從這個時候_t_。如果_t_早于當前時間,返回的秒數為負。 因為[QTime](qtime.html)測量時間在一天之內,并有一天86400秒,結果總是-86400和86400之間。 secsTo ()不考慮任何毫秒。 **See also** [addSecs](qtime.html#addSecs)()和[QDateTime.secsTo](qdatetime.html#secsTo)( ) 。 ``` bool QTime.setHMS (self, int?h, int?m, int?s, int?msec?=?0) ``` 設置時間小時_h_,分_m_,秒_s_和毫秒_ms_。 _h_必須在范圍0?23,_m_和_s_必須在范圍0 ?59,_ms_必須在范圍0到999 。返回True如果設定的時間是有效的,否則返回False 。 **See also** [isValid](qtime.html#isValid)( ) 。 ``` QTime.start (self) ``` 設置這個時間設置為當前時間。這是不切實際的時機: ``` [QTime](qtime.html) t; t.start(); some_lengthy_task(); qDebug("Time elapsed: %d ms", t.elapsed()); ``` **See also** [restart](qtime.html#restart)( )[elapsed](qtime.html#elapsed)()和[currentTime](qtime.html#currentTime)( ) 。 ``` datetime.time QTime.toPyTime (self) ``` ``` QString QTime.toString (self, Qt.DateFormat?format?=?Qt.TextDate) ``` 返回時間為一個字符串。該_format_參數決定了結果字符串的格式。 這些表達式可用于: | Expression | Output | | --- | --- | | h | the hour without a leading zero (0 to 23 or 1 to 12 if AM/PM display) | | hh | the hour with a leading zero (00 to 23 or 01 to 12 if AM/PM display) | | H | the hour without a leading zero (0 to 23, even with AM/PM display) | | HH | the hour with a leading zero (00 to 23, even with AM/PM display) | | m | the minute without a leading zero (0 to 59) | | mm | the minute with a leading zero (00 to 59) | | s | the second without a leading zero (0 to 59) | | ss | the second with a leading zero (00 to 59) | | z | the milliseconds without leading zeroes (0 to 999) | | zzz | the milliseconds with leading zeroes (000 to 999) | | AP or A | use AM/PM display. _AP_ will be replaced by either "AM" or "PM". | | ap or a | use am/pm display. _ap_ will be replaced by either "am" or "pm". | | t | the timezone (for example "CEST") | 所有其它輸入的字符將被忽略。括在singlequotes任何字符序列將被視為文本,而不是被用作表達。連續兩singlequotes ( “''” )是由singlequote輸出所取代。 例如格式字符串(假設[QTime](qtime.html)是14:13:09.042 ) | Format | Result | | --- | --- | | hh:mm:ss.zzz | 14:13:09.042 | | h:m:s ap | 2:13:9 pm | | H:m:s a | 14:13:9 pm | 如果日期時間是無效的,空字符串將被返回。如果_format_是空的,默認的格式為“ HH : MM:SS ”一詞。 **See also** [QDate.toString](qdate.html#toString)()和[QDateTime.toString](qdatetime.html#toString)( ) 。 ``` QString QTime.toString (self, QString?format) ``` 這是一個重載函數。 返回時間為一個字符串。毫秒不包括在內。該_format_參數確定字符串的格式。 If _format_ is [Qt.TextDate](qt.html#DateFormat-enum),字符串格式為HH : MM:SS ;例如午夜在1秒將是“ 23:59:59 ” 。 If _format_ is [Qt.ISODate](qt.html#DateFormat-enum),字符串格式對應于ISO 8601擴展規格的日期,這也是HH的表示: MM:SS 。 (然而,與ISO 8601 ,日期1582年10月15日之前為Julian日期,而不是公歷日期的處理方式。見[Use of Gregorian and Julian Calendars](qdate.html#qdate-g-and-j)。這可能會改變的Qt的未來版本。 ) 如果_format_ is [Qt.SystemLocaleShortDate](qt.html#DateFormat-enum) or [Qt.SystemLocaleLongDate](qt.html#DateFormat-enum),字符串格式取決于系統的區域設置。相同的調用[QLocale.system](qlocale.html#system)( ) 。的toString (時間,[QLocale.ShortFormat](qlocale.html#FormatType-enum))或[QLocale.system](qlocale.html#system)( ) 。的toString (時間,[QLocale.LongFormat](qlocale.html#FormatType-enum)) 。 如果_format_ is [Qt.DefaultLocaleShortDate](qt.html#DateFormat-enum) or [Qt.DefaultLocaleLongDate](qt.html#DateFormat-enum),字符串格式依賴于默認應用程序的語言環境。這就是語言環境設置[QLocale.setDefault](qlocale.html#setDefault)( )或系統區域設置,如果沒有默認區域設置已定。相同的調用QLocale ( ) 。的toString (時間,[QLocale.ShortFormat](qlocale.html#FormatType-enum))或QLocale ( ) 。的toString (時間,[QLocale.LongFormat](qlocale.html#FormatType-enum)) 。 如果時間是無效的,空字符串將被返回。 ``` int QTime.__bool__ (self) ``` ``` bool QTime.__eq__ (self, QTime?other) ``` ``` bool QTime.__ge__ (self, QTime?other) ``` ``` bool QTime.__gt__ (self, QTime?other) ``` ``` int QTime.__hash__ (self) ``` ``` bool QTime.__le__ (self, QTime?other) ``` ``` bool QTime.__lt__ (self, QTime?other) ``` ``` bool QTime.__ne__ (self, QTime?other) ``` ``` str QTime.__repr__ (self) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看