Package schrodinger :: Package application :: Package jaguar :: Package gui :: Module input_tab_widgets :: Class BlankableSpinBox
[hide private]
[frames] | no frames]

Class BlankableSpinBox

       object --+                        
                |                        
sip.simplewrapper --+                    
                    |                    
          sip.wrapper --+                
                        |                
     PyQt4.QtCore.QObject --+            
                            |            
           object --+       |            
                    |       |            
    sip.simplewrapper --+   |            
                        |   |            
 PyQt4.QtGui.QPaintDevice --+            
                            |            
          PyQt4.QtGui.QWidget --+        
                                |        
     PyQt4.QtGui.QAbstractSpinBox --+    
                                    |    
                 PyQt4.QtGui.QSpinBox --+
                                        |
                                       BlankableSpinBox

A spin box that allows the empty string as an acceptable value

Nested Classes [hide private]

Inherited from PyQt4.QtGui.QAbstractSpinBox: ButtonSymbols, CorrectionMode, StepEnabled, StepEnabledFlag

Inherited from PyQt4.QtGui.QWidget: RenderFlag, RenderFlags

Inherited from PyQt4.QtGui.QPaintDevice: PaintDeviceMetric

Instance Methods [hide private]
 
__init__(self, parent, default=0)
Initialize the spin box with a range from -99 to 99.
PyQt4.QtCore.QInt
valueFromText(self, text)
Convert the specified text to an integer.
str
textFromValue(self, value)
Convert the specified integer to text.
 
stepBy(self, steps)
Increment the value of the spin box by the specified amount.
 
validate(self, input_text, pos)
Is the provided input acceptable? The blank string is considered acceptable.
int or NoneType
value(self)
Return the current value in the spin box.
int
stepEnabled(self)
Report on whether stepping up and down is allowed.

Inherited from PyQt4.QtGui.QSpinBox: cleanText, event, fixup, maximum, minimum, prefix, setMaximum, setMinimum, setPrefix, setRange, setSingleStep, setSuffix, setValue, singleStep, suffix, valueChanged

Inherited from PyQt4.QtGui.QAbstractSpinBox: alignment, buttonSymbols, changeEvent, clear, closeEvent, contextMenuEvent, correctionMode, editingFinished, focusInEvent, focusOutEvent, hasAcceptableInput, hasFrame, hideEvent, initStyleOption, inputMethodQuery, interpretText, isAccelerated, isReadOnly, keyPressEvent, keyReleaseEvent, keyboardTracking, lineEdit, minimumSizeHint, mouseMoveEvent, mousePressEvent, mouseReleaseEvent, paintEvent, resizeEvent, selectAll, setAccelerated, setAlignment, setButtonSymbols, setCorrectionMode, setFrame, setKeyboardTracking, setLineEdit, setReadOnly, setSpecialValueText, setWrapping, showEvent, sizeHint, specialValueText, stepDown, stepUp, text, timerEvent, wheelEvent, wrapping

Inherited from PyQt4.QtGui.QWidget: acceptDrops, accessibleDescription, accessibleName, actionEvent, actions, activateWindow, addAction, addActions, adjustSize, autoFillBackground, backgroundRole, baseSize, childAt, childrenRect, childrenRegion, clearFocus, clearMask, close, contentsMargins, contentsRect, contextMenuPolicy, create, cursor, customContextMenuRequested, destroy, devType, dragEnterEvent, dragLeaveEvent, dragMoveEvent, dropEvent, effectiveWinId, enabledChange, ensurePolished, enterEvent, find, focusNextChild, focusNextPrevChild, focusPolicy, focusPreviousChild, focusProxy, focusWidget, font, fontChange, fontInfo, fontMetrics, foregroundRole, frameGeometry, frameSize, geometry, getContentsMargins, grabGesture, grabKeyboard, grabMouse, grabShortcut, graphicsEffect, graphicsProxyWidget, handle, hasFocus, hasMouseTracking, height, heightForWidth, hide, inputContext, inputMethodEvent, inputMethodHints, insertAction, insertActions, isActiveWindow, isAncestorOf, isEnabled, isEnabledTo, isEnabledToTLW, isFullScreen, isHidden, isLeftToRight, isMaximized, isMinimized, isModal, isRightToLeft, isTopLevel, isVisible, isVisibleTo, isWindow, isWindowModified, keyboardGrabber, languageChange, layout, layoutDirection, leaveEvent, locale, lower, mapFrom, mapFromGlobal, mapFromParent, mapTo, mapToGlobal, mapToParent, mask, maximumHeight, maximumSize, maximumWidth, metric, minimumHeight, minimumSize, minimumWidth, mouseDoubleClickEvent, mouseGrabber, move, moveEvent, nativeParentWidget, nextInFocusChain, normalGeometry, overrideWindowFlags, overrideWindowState, paintEngine, palette, paletteChange, parentWidget, pos, previousInFocusChain, raise_, rect, releaseKeyboard, releaseMouse, releaseShortcut, removeAction, render, repaint, resetInputContext, resize, restoreGeometry, saveGeometry, scroll, setAcceptDrops, setAccessibleDescription, setAccessibleName, setAttribute, setAutoFillBackground, setBackgroundRole, setBaseSize, setContentsMargins, setContextMenuPolicy, setCursor, setDisabled, setEnabled, setFixedHeight, setFixedSize, setFixedWidth, setFocus, setFocusPolicy, setFocusProxy, setFont, setForegroundRole, setGeometry, setGraphicsEffect, setHidden, setInputContext, setInputMethodHints, setLayout, setLayoutDirection, setLocale, setMask, setMaximumHeight, setMaximumSize, setMaximumWidth, setMinimumHeight, setMinimumSize, setMinimumWidth, setMouseTracking, setPalette, setParent, setShortcutAutoRepeat, setShortcutEnabled, setShown, setSizeIncrement, setSizePolicy, setStatusTip, setStyle, setStyleSheet, setTabOrder, setToolTip, setUpdatesEnabled, setVisible, setWhatsThis, setWindowFilePath, setWindowFlags, setWindowIcon, setWindowIconText, setWindowModality, setWindowModified, setWindowOpacity, setWindowRole, setWindowState, setWindowTitle, show, showFullScreen, showMaximized, showMinimized, showNormal, size, sizeIncrement, sizePolicy, stackUnder, statusTip, style, styleSheet, tabletEvent, testAttribute, toolTip, topLevelWidget, underMouse, ungrabGesture, unsetCursor, unsetLayoutDirection, unsetLocale, update, updateGeometry, updateMicroFocus, updatesEnabled, visibleRegion, whatsThis, width, winId, window, windowActivationChange, windowFilePath, windowFlags, windowIcon, windowIconText, windowModality, windowOpacity, windowRole, windowState, windowTitle, windowType, x, x11Info, x11PictureHandle, y

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

Inherited from PyQt4.QtGui.QPaintDevice: colorCount, depth, heightMM, logicalDpiX, logicalDpiY, numColors, paintingActive, physicalDpiX, physicalDpiY, widthMM

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.QAbstractSpinBox: CorrectToNearestValue, CorrectToPreviousValue, NoButtons, PlusMinus, StepDownEnabled, StepNone, StepUpEnabled, UpDownArrows

Inherited from PyQt4.QtGui.QWidget: DrawChildren, DrawWindowBackground, IgnoreMask

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Inherited from PyQt4.QtGui.QPaintDevice: PdmDepth, PdmDpiX, PdmDpiY, PdmHeight, PdmHeightMM, PdmNumColors, PdmPhysicalDpiX, PdmPhysicalDpiY, PdmWidth, PdmWidthMM

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, default=0)
(Constructor)

 

Initialize the spin box with a range from -99 to 99. -100 is used as the sentinel value for empty string.

Parameters:
  • parent (PyQt4.QtWidgets.QWidget) - The Qt parent
  • default (int) - The default value, i.e. what value should we starting counting from if the user clears the spin box and then increments.
Overrides: object.__init__

valueFromText(self, text)

 

Convert the specified text to an integer. "" is converted to -100.

Parameters:
  • text (str) - The text to convert
Returns: PyQt4.QtCore.QInt
The converted text
Overrides: PyQt4.QtGui.QSpinBox.valueFromText

textFromValue(self, value)

 

Convert the specified integer to text. -100 is converted to "".

Parameters:
  • value (int) - The integer to convert
Returns: str
The converted integer
Overrides: PyQt4.QtGui.QSpinBox.textFromValue

stepBy(self, steps)

 

Increment the value of the spin box by the specified amount. If the spin box contains "" before incrementing, load the default value.

Parameters:
  • steps (int) - The value to increment the spin box by
Overrides: PyQt4.QtGui.QAbstractSpinBox.stepBy

validate(self, input_text, pos)

 

Is the provided input acceptable? The blank string is considered acceptable.

See PyQt documentation for argument and return value documentation.

Overrides: PyQt4.QtGui.QAbstractSpinBox.validate

value(self)

 

Return the current value in the spin box. If the spin box is blank, None is returned.

Returns: int or NoneType
The current value in the spin box
Overrides: PyQt4.QtGui.QSpinBox.value

stepEnabled(self)

 

Report on whether stepping up and down is allowed. When the spin box is blank, the user can step both up and down. The user cannot step down to the minimum, since that is a sentinel value.

Returns: int
A flag indicating whether stepping is allowed
Overrides: PyQt4.QtGui.QAbstractSpinBox.stepEnabled