Package schrodinger :: Package ui :: Package qt :: Module appframework :: Class MPICPUValidator
[hide private]
[frames] | no frames]

Class MPICPUValidator

                       object --+        
                                |        
 swidgets.EnforcingValidatorMixin --+    
                                    |    
       object --+                   |    
                |                   |    
sip.simplewrapper --+               |    
                    |               |    
          sip.wrapper --+           |    
                        |           |    
     PyQt4.QtCore.QObject --+       |    
                            |       |    
       PyQt4.QtGui.QValidator --+   |    
                                |   |    
        PyQt4.QtGui.QIntValidator --+    
                                    |    
    swidgets.SNonNegativeIntValidator --+
                                        |
                                       MPICPUValidator

Int validator that doesn't allow 0 alone, stores the last valid value and emits a validValue signal when a valid value is entered.

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QValidator: State

Instance Methods [hide private]
 
__init__(self, bottom=1)
Create a MPICPUValidator instance
 
validValue(...)
tuple
validate(self, input, pos)
Check if a value is valid.

Inherited from swidgets.EnforcingValidatorMixin: restoreLastValidValue

Inherited from PyQt4.QtGui.QIntValidator: bottom, fixup, setBottom, setRange, setTop, top

Inherited from PyQt4.QtGui.QValidator: locale, setLocale

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, parent, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from PyQt4.QtGui.QValidator: Acceptable, Intermediate, Invalid

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bottom=1)
(Constructor)

 

Create a MPICPUValidator instance

Parameters:
  • bottom (int) - Least number of CPUs allowed
Overrides: object.__init__

validate(self, input, pos)

 

Check if a value is valid. We overwrite the parent to prevent a lone 0 from being used (parent allows 0 as an 'Intermediate' value). Also stores the last valid value and also emits aster.updateMPIInfo for Acceptable input.

Parameters:
  • input (QString) - The proposed new value
  • pos (int) - The cursor position
Returns: tuple
QtGui.QValidator return values
Overrides: PyQt4.QtGui.QValidator.validate