Python PyQt4.QtGui 模块,QIntValidator() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用PyQt4.QtGui.QIntValidator()

项目:MK8-Editor    作者:TheKoopaKingdom    | 项目源码 | 文件源码
def IntEdit(v,cb):
    edit = LineEdit(v,cb)
    edit.setValidator(QtGui.QIntValidator())
    return edit

# renames the settings names, not ported to mk8 yet
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QLineEdit.__init__(self, parent)
        self.setValidator(QtGui.QIntValidator(self))
        self.setValue(self.getDefaultValue(), undo=False)
项目:Comictagger    作者:dickloraine    | 项目源码 | 文件源码
def __init__(self, parent, settings ):
        super(SettingsWindow, self).__init__(parent)

        uic.loadUi(ComicTaggerSettings.getUIFile('settingswindow.ui' ), self)

        self.setWindowFlags(self.windowFlags() &
                                      ~QtCore.Qt.WindowContextHelpButtonHint )

        self.settings = settings        
        self.name = "Settings"

        if platform.system() == "Windows":
            self.lblUnrar.hide()
            self.leUnrarExePath.hide()
            self.btnBrowseUnrar.hide()          
            self.lblRarHelp.setText( windowsRarHelp )

        elif platform.system() == "Linux":
            self.lblRarHelp.setText( linuxRarHelp )

        elif platform.system() == "Darwin":
            self.lblRarHelp.setText( macRarHelp )
            self.name = "Preferences"

        self.setWindowTitle("ComicTagger " + self.name)
        self.lblDefaultSettings.setText( "Revert to default " + self.name.lower())
        self.btnResetSettings.setText( "Default " + self.name)


        nldtTip = (
            """ <html>The <b>Default Name Length Match Tolerance</b> is for eliminating automatic
                search matches that are too long compared to your series name search. The higher
                it is, the more likely to have a good match, but each search will take longer and
                use more bandwidth. Too low, and only the very closest lexical matches will be
                explored.</html>""" )

        self.leNameLengthDeltaThresh.setToolTip(nldtTip)

        pblTip = (
            """<html>
            The <b>Publisher Blacklist</b> is for eliminating automatic matches to certain publishers
            that you know are incorrect. Useful for avoiding international re-prints with same
            covers or series names. Enter publisher names separated by commas.
            </html>"""
        )
        self.tePublisherBlacklist.setToolTip(pblTip)

        validator = QtGui.QIntValidator(1, 4, self)
        self.leIssueNumPadding.setValidator(validator)

        validator = QtGui.QIntValidator(0, 99, self)
        self.leNameLengthDeltaThresh.setValidator(validator)

        self.settingsToForm()

        self.btnBrowseRar.clicked.connect(self.selectRar)
        self.btnBrowseUnrar.clicked.connect(self.selectUnrar)       
        self.btnClearCache.clicked.connect(self.clearCache)
        self.btnResetSettings.clicked.connect(self.resetSettings)
        self.btnTestKey.clicked.connect(self.testAPIKey)
项目:PyFRAP    作者:alexblaessle    | 项目源码 | 文件源码
def __init__(self,parent):

        super(basicSettingsDialog,self).__init__(parent)

        self.setMinimumSize(500,500) 
        self.resize(700,500)

        #-------------------------------------------------------------------------------------------------------------------
        #Buttons
        #-------------------------------------------------------------------------------------------------------------------

        #Done button
        self.btnDone=QtGui.QPushButton('Done')
        self.btnDone.connect(self.btnDone, QtCore.SIGNAL('clicked()'), self.donePressed)

        #-------------------------------------------------------------------------------------------------------------------
        #Layout
        #-------------------------------------------------------------------------------------------------------------------

        self.grid = QtGui.QGridLayout()     
        self.grid.setColumnMinimumWidth(2,20) 

        #-------------------------------------------------------------------------------------------------------------------
        #Validators
        #-------------------------------------------------------------------------------------------------------------------

        self.doubleValid=QtGui.QDoubleValidator()
        self.intValid=QtGui.QIntValidator()

        #-------------------------------------------------------------------------------------------------------------------
        #Final Layout
        #-------------------------------------------------------------------------------------------------------------------

        self.vbox = QtGui.QVBoxLayout()
        self.vbox.addLayout(self.grid)

        self.hbox = QtGui.QHBoxLayout()
        self.hbox.addWidget(self.btnDone,stretch=0,alignment=QtCore.Qt.AlignRight)  
        self.vbox.addLayout(self.hbox)

        self.setLayout(self.vbox)    

        self.setWindowTitle('basicSettingsDialog')
项目:PyFRAP    作者:alexblaessle    | 项目源码 | 文件源码
def __init__(self,mesh,parent):

        super(basicForceMeshSettingsDialog,self).__init__(parent)

        #Pass mesh
        self.mesh = mesh
        self.parent=parent
        self.embryo=self.mesh.simulation.embryo

        #Set default variables
        self.roiUsed=None
        self.debug=False
        self.findIdxs=True

        #Labels
        self.lblROI = QtGui.QLabel("ROI used:", self)
        self.lblDebug = QtGui.QLabel("Print debugging output:", self)
        self.lblFindIdxs = QtGui.QLabel("Update Indices?:", self)

        #LineEdits
        self.doubleValid=QtGui.QDoubleValidator()
        self.intValid=QtGui.QIntValidator()

        #Combobox
        self.comboROI = QtGui.QComboBox(self)
        self.updateROICombo()

        self.comboROI.activated[str].connect(self.setROI)   

        #CheckBox
        self.cbDebug = QtGui.QCheckBox('', self)
        self.cbFindIdxs = QtGui.QCheckBox('', self)

        self.connect(self.cbDebug, QtCore.SIGNAL('stateChanged(int)'), self.checkDebug)
        self.connect(self.cbFindIdxs, QtCore.SIGNAL('stateChanged(int)'), self.checkFindIdxs)


        #Layout 
        self.grid.addWidget(self.lblROI,1,1)
        self.grid.addWidget(self.lblFindIdxs,4,1)
        self.grid.addWidget(self.lblDebug,6,1)

        self.grid.addWidget(self.comboROI,1,2)
        self.grid.addWidget(self.cbFindIdxs,4,2)
        self.grid.addWidget(self.cbDebug,6,2)

        self.setWindowTitle("Basic Force Mesh Settings")

        self.show()