SpinBox — pyqtgraph 0.9.8 documentation

### Navigation

- index
- modules |
- next |
- previous |
- pyqtgraph 0.9.8 documentation »
- API Reference »
- Pyqtgraph’s Widgets »

# SpinBox

class `pyqtgraph.` `SpinBox`(parent=None, value=0.0, **kwargs)

  Bases: QtGui.QAbstractSpinBox

  QSpinBox widget on steroids. Allows selection of numerical value, with extra features:

  - SI prefix notation (eg, automatically display “300 mV” instead of “0.003 V”)
  - Float values with linear and decimal stepping (1-9, 10-90, 100-900, etc.)
  - Option for unbounded values
  - Delayed signals (allows multiple rapid changes with only one change signal)

  Signals: |
  valueChanged(value) | Same as QSpinBox; emitted every time the value has changed.
  sigValueChanged(self) | Emitted when value has changed, but also combines multiple rapid changes into one signal (eg, when rolling the mouse wheel).
  sigValueChanging(self, value) | Emitted immediately for all value changes.

  `__init__`(parent=None, value=0.0, **kwargs)

    Arguments: |
    parent | Sets the parent widget for this SpinBox (optional)
    value | (float/int) initial value
    bounds | (min,max) Minimum and maximum values allowed in the SpinBox. Either may be None to leave the value unbounded.
    suffix | (str) suffix (units) to display after the numerical value
    siPrefix | (bool) If True, then an SI prefix is automatically prepended to the units and the value is scaled accordingly. For example, if value=0.003 and suffix=’V’, then the SpinBox will display “300 mV” (but a call to SpinBox.value will still return 0.003).
    step | (float) The size of a single step. This is used when clicking the up/ down arrows, when rolling the mouse wheel, or when pressing keyboard arrows while the widget has keyboard focus. Note that the interpretation of this value is different when specifying the ‘dec’ argument.
    dec | (bool) If True, then the step value will be adjusted to match the current size of the variable (for example, a value of 15 might step in increments of 1 whereas a value of 1500 would step in increments of 100). In this case, the ‘step’ argument is interpreted relative to the current value. The most common ‘step’ values when dec=True are 0.1, 0.2, 0.5, and 1.0.
    minStep | (float) When dec=True, this specifies the minimum allowable step size.
    int | (bool) if True, the value is forced to integer type
    decimals | (int) Number of decimal values to display

  `editingFinishedEvent`()

    Edit has finished; set value.

  `interpret`()

    Return value of text. Return False if text is invalid, raise exception if text is intermediate

  `setMaximum`(m, update=True)

    Set the maximum allowed value (or None for no limit)

  `setMinimum`(m, update=True)

    Set the minimum allowed value (or None for no limit)

  `setOpts`(**opts)

    Changes the behavior of the SpinBox. Accepts most of the arguments allowed in `__init__`.

  `setValue`(value=None, update=True, delaySignal=False)

    Set the value of this spin. If the value is out of bounds, it will be clipped to the nearest boundary. If the spin is integer type, the value will be coerced to int. Returns the actual value set.

    If value is None, then the current value is used (this is for resetting the value after bounds, etc. have changed)

  `value`()

    Return the value of this SpinBox.

### Navigation

- index
- modules |
- next |
- previous |
- pyqtgraph 0.9.8 documentation »
- API Reference »
- Pyqtgraph’s Widgets »