<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>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # QIntValidator Class Reference ## [[QtGui](index.htm) module] 該QIntValidator類提供了一個驗證器,確保一個字符串包含一個指定范圍內的有效整數。[More...](#details) 繼承[QValidator](qvalidator.html)。 ### Methods * `__init__ (self, QObject?parent?=?None)` * `__init__ (self, int?bottom, int?top, QObject?parent?=?None)` * `int bottom (self)` * `QString?input fixup (self, QString?input)` * `fixup (self, QString?input)` * `setBottom (self, int)` * `setRange (self, int?bottom, int?top)` * `setTop (self, int)` * `int top (self)` * `(QValidator.State, QString, int) validate (self, QString, int)` * `(QValidator.State, int) validate (self, QString, int)` * * * ## Detailed Description 該QIntValidator類提供了一個驗證器,確保一個字符串包含一個指定范圍內的有效整數。 使用示例: ``` [QValidator](qvalidator.html) *validator = new QIntValidator(100, 999, this); [QLineEdit](qlineedit.html) *edit = new [QLineEdit](qlineedit.html)(this); // the edit lineedit will only accept integers between 100 and 999 edit->setValidator(validator); ``` 下面,我們提出校驗器的一些例子。在實踐中,它們通常會被一個小部件如在上面的例子有關。 ``` [QString](qstring.html) str; int pos = 0; QIntValidator v(100, 900, this); str = "1"; v.validate(str, pos); // returns Intermediate str = "012"; v.validate(str, pos); // returns Intermediate str = "123"; v.validate(str, pos); // returns Acceptable str = "678"; v.validate(str, pos); // returns Acceptable str = "999"; v.validate(str, pos); // returns Intermediate str = "1234"; v.validate(str, pos); // returns Invalid str = "-123"; v.validate(str, pos); // returns Invalid str = "abc"; v.validate(str, pos); // returns Invalid str = "12cm"; v.validate(str, pos); // returns Invalid ``` 注意,該值`999`返回中間。值組成的數字位數等于或小于最大值被認為是中間。這樣做的目的是因為,可以防止一些是在范圍中的位數不一定是最后一個數字類型的。這也意味著,一個中間數可以有前導零。 的最小值和最大值都設置在一個呼叫與[setRange](qintvalidator.html#setRange)(),或者單獨用[setBottom](qintvalidator.html#bottom-prop)()和[setTop](qintvalidator.html#top-prop)( ) 。 QIntValidator使用其[locale](qvalidator.html#locale)()來解釋的數目。例如,在阿拉伯語語言環境, QIntValidator將接受阿拉伯數字。此外, QIntValidator始終保證接受了一些根據“C”區域設置。 * * * ## Method Documentation ``` QIntValidator.__init__ (self, QObject?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個驗證用_parent_對象,它接受所有的整數。 ``` QIntValidator.__init__ (self, int?bottom, int?top, QObject?parent?=?None) ``` 該_parent_的說法,如果不是沒有,原因_self_通過Qt的,而不是PyQt的擁有。 構造一個驗證用_parent_,接受來自整數_minimum_至_maximum_包容性。 ``` int QIntValidator.bottom (self) ``` ``` QString?input QIntValidator.fixup (self, QString?input) ``` 從重新實現[QValidator.fixup](qvalidator.html#fixup)( ) 。 ``` QIntValidator.fixup (self, QString?input) ``` ``` QIntValidator.setBottom (self, int) ``` ``` QIntValidator.setRange (self, int?bottom, int?top) ``` 設置驗證程序的范圍只接受之間的整數_bottom_和_top_包容性。 ``` QIntValidator.setTop (self, int) ``` ``` int QIntValidator.top (self) ``` ``` (QValidator.State, QString, int) QIntValidator.validate (self, QString, int) ``` 從重新實現[QValidator.validate](qvalidator.html#validate)( ) 。 Returns [Acceptable](qvalidator.html#State-enum)如果_input_是在有效范圍內的整數,[Intermediate](qvalidator.html#State-enum)如果_input_是一個整數的有效范圍內的前綴,并[Invalid](qvalidator.html#State-enum)否則。 如果有效范圍只包括正整數(例如, 32到100 ),并_input_是一個負整數,則無效返回。 (在另一方面,如果該范圍包括負整數(例如,-100到-32 )的和_input_是一個正整數,然后中間返回,因為用戶可能只是鍵入減號(尤其是從右到左的語言) 。 ``` int pos = 0; s = "abc"; v.validate(s, pos); // returns Invalid s = "5"; v.validate(s, pos); // returns Intermediate s = "50"; v.validate(s, pos); // returns Acceptable ``` 默認情況下,_pos_參數不使用此驗證程序。 ``` (QValidator.State, int) QIntValidator.validate (self, QString, int) ```
                  <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>

                              哎呀哎呀视频在线观看