久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<small id='JESyg'></small><noframes id='JESyg'>

  • <legend id='JESyg'><style id='JESyg'><dir id='JESyg'><q id='JESyg'></q></dir></style></legend>
    <tfoot id='JESyg'></tfoot>
    • <bdo id='JESyg'></bdo><ul id='JESyg'></ul>
    <i id='JESyg'><tr id='JESyg'><dt id='JESyg'><q id='JESyg'><span id='JESyg'><b id='JESyg'><form id='JESyg'><ins id='JESyg'></ins><ul id='JESyg'></ul><sub id='JESyg'></sub></form><legend id='JESyg'></legend><bdo id='JESyg'><pre id='JESyg'><center id='JESyg'></center></pre></bdo></b><th id='JESyg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='JESyg'><tfoot id='JESyg'></tfoot><dl id='JESyg'><fieldset id='JESyg'></fieldset></dl></div>

        PyQt QLineEdit 與 QValidator

        PyQt QLineEdit with QValidator(PyQt QLineEdit 與 QValidator)
        <legend id='8x8fS'><style id='8x8fS'><dir id='8x8fS'><q id='8x8fS'></q></dir></style></legend>

        <i id='8x8fS'><tr id='8x8fS'><dt id='8x8fS'><q id='8x8fS'><span id='8x8fS'><b id='8x8fS'><form id='8x8fS'><ins id='8x8fS'></ins><ul id='8x8fS'></ul><sub id='8x8fS'></sub></form><legend id='8x8fS'></legend><bdo id='8x8fS'><pre id='8x8fS'><center id='8x8fS'></center></pre></bdo></b><th id='8x8fS'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8x8fS'><tfoot id='8x8fS'></tfoot><dl id='8x8fS'><fieldset id='8x8fS'></fieldset></dl></div>

        <tfoot id='8x8fS'></tfoot>
        • <bdo id='8x8fS'></bdo><ul id='8x8fS'></ul>
            <tbody id='8x8fS'></tbody>

          <small id='8x8fS'></small><noframes id='8x8fS'>

                • 本文介紹了PyQt QLineEdit 與 QValidator的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我的項目中有一個 QLineEdit.我想在 lineEdit 上使用 QValidation.

                  I have a QLineEdit in my project. I want to use the QValidation on lineEdit.

                  #Create lineEdit
                  itemValue = QtWidgets.QLineEdit()
                  #Create валидатор
                  objValidator = QtGui.QDoubleValidator(self)
                  #setup range
                  objValidator.setRange(-10.0, 100.0, 5)
                  #lineEdit with validation
                  itemValue.setValidator(objValidator)
                  

                  但效果不好.我可以輸入我想要的,除了符號.而且范圍不起作用!我可以輸入 100500 或 -100500,但我希望,該用戶只能輸入范圍內的數字.

                  But it doesn't work well.I can type what i want, except symbols. And range doesn't work!I can type 100500 or -100500, but i want, that user can enter numbers only in range.

                  我應該如何使用范圍?我需要幫助:)

                  How i should use range? I need help:)

                  謝謝你們的幫助,伙計們!

                  Thanks for your help, guys!

                  推薦答案

                  默認情況下,驗證器不會阻止輸入超出范圍的值,如果輸入的值也不會阻止用戶離開行編輯是無效或中間.

                  By default, a validator will not prevent values outside the range from being entered, and it won't prevent the user leaving the line-edit if the entered value is Invalid or Intermediate.

                  但是,它確實讓您有機會以編程方式拒絕輸入,因為只要當前值不可接受,行編輯就不會發出它的 editingFinished 或 returnPressed 信號,及其 hasAcceptableInput 方法將返回 False.另外,如果你子類化驗證器,你可以重新實現它的 fixup 方法來控制輸入的值.

                  However, it does give you an opportunity to reject the input programmatically, because whenever the current value is unacceptable, the line-edit won't emit its editingFinished or returnPressed signals, and its hasAcceptableInput method will return False. In addition, if you subclass the validator, you can reimplement its fixup method to control the values that are entered.

                  然而,正如已經建議的那樣,更好/更簡單的解決方案是使用 QDoubleSpinBox,因為它會自動清理輸入并提供更友好的用戶界面.

                  However, as has been suggested already, a far better/simpler solution is to use a QDoubleSpinBox, since it cleans up the input automatically and provides a more user-friendly interface.

                  這篇關于PyQt QLineEdit 與 QValidator的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)

                  1. <i id='uKqIm'><tr id='uKqIm'><dt id='uKqIm'><q id='uKqIm'><span id='uKqIm'><b id='uKqIm'><form id='uKqIm'><ins id='uKqIm'></ins><ul id='uKqIm'></ul><sub id='uKqIm'></sub></form><legend id='uKqIm'></legend><bdo id='uKqIm'><pre id='uKqIm'><center id='uKqIm'></center></pre></bdo></b><th id='uKqIm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uKqIm'><tfoot id='uKqIm'></tfoot><dl id='uKqIm'><fieldset id='uKqIm'></fieldset></dl></div>

                      <bdo id='uKqIm'></bdo><ul id='uKqIm'></ul>

                    • <tfoot id='uKqIm'></tfoot>

                      <small id='uKqIm'></small><noframes id='uKqIm'>

                            <tbody id='uKqIm'></tbody>
                          <legend id='uKqIm'><style id='uKqIm'><dir id='uKqIm'><q id='uKqIm'></q></dir></style></legend>

                            主站蜘蛛池模板: 日韩专区在线 | 青青青草视频在线观看 | 黄色影院在线观看 | 国产精品乱码一区二区视频 | 欧美日韩精品久久久免费观看 | 特级西西444www大精品视频 | 69av在线播放| 欧美视频久久 | 黄色片视频免费 | 亚洲精品一区二区三区蜜桃久 | 亚洲精品一二 | 黄色一级视频 | 日韩不卡在线观看 | 久久久久久黄色 | 黄色伊人 | 黄色国产在线观看 | 黄色成年人视频 | 中文精品一区 | 99福利视频| 欧美日韩在线一区二区 | 91精品国产99久久久久久红楼 | 中文天堂在线观看 | 日本成人一区二区三区 | 亚洲精品一区二区在线观看 | 第一福利视频 | 国产精品99久久久久久久久 | 亚洲精品一二三区 | 成人在线精品 | 国产精品毛片一区视频播 | 精品久久久久久久久久久久久 | 欧美在线激情 | av网站免费在线观看 | 最新日韩在线 | 国产成人在线免费视频 | 亚洲成人日韩 | 18成人免费观看网站 | 午夜av网站 | 中文一级片 | 久久99视频 | 日韩在线精品视频 | 欧美二区视频 |