Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
qtwidgets.scientific_spinbox.ScienDSpinBox Class Reference
Inheritance diagram for qtwidgets.scientific_spinbox.ScienDSpinBox:
Inheritance graph
[legend]
Collaboration diagram for qtwidgets.scientific_spinbox.ScienDSpinBox:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, args, kwargs)
 
def dynamic_stepping (self)
 
def dynamic_stepping (self, use_dynamic_stepping)
 
def dynamic_precision (self)
 
def dynamic_precision (self, use_dynamic_precision)
 
def assumed_unit_prefix (self)
 This property can fix a default unit prefix that is used for text input. More...
 
def assumed_unit_prefix (self, unit_prefix)
 This property can fix a default unit prefix that is used for text input. More...
 
def is_valid (self)
 
def update_value (self)
 
def value (self)
 Getter method to obtain the current value as float. More...
 
def setValue (self, value)
 
def setProperty (self, prop, val)
 For compatibility with QtDesigner. More...
 
def check_range (self, value)
 
def minimum (self)
 
def setMinimum (self, minimum)
 
def maximum (self)
 
def setMaximum (self, maximum)
 
def setRange (self, minimum, maximum)
 
def decimals (self)
 
def setDecimals (self, decimals, dynamic_precision=True)
 
def prefix (self)
 
def setPrefix (self, prefix)
 Set a string to be shown as non-editable prefix in the spinbox. More...
 
def suffix (self)
 
def setSuffix (self, suffix)
 
def singleStep (self)
 
def setSingleStep (self, step, dynamic_stepping=True)
 Method to set the stepping behaviour of the spinbox (e.g. More...
 
def minimalStep (self)
 
def setMinimalStep (self, step)
 
def cleanText (self)
 
def update_display (self)
 
def keyPressEvent (self, event)
 
def focusInEvent (self, event)
 
def focusOutEvent (self, event)
 
def paintEvent (self, ev)
 Add drawing of a red frame around the spinbox if the is_valid flag is False.
 
def validate (self, text, position)
 Access method to the validator. More...
 
def fixup (self, text)
 
def valueFromText (self, text, use_assumed_unit_prefix=False)
 This method is responsible for converting a string displayed in the SpinBox into a Decimal. More...
 
def textFromValue (self, value)
 
def stepEnabled (self)
 Enables stepping (mouse wheel, arrow up/down, clicking, PgUp/Down) by default.
 
def stepBy (self, steps)
 
def selectAll (self)
 

Public Attributes

 validator
 
 dynamic_precision
 
 dynamic_stepping
 

Static Public Attributes

 valueChanged = QtCore.Signal(object)
 

Member Function Documentation

◆ assumed_unit_prefix() [1/2]

def qtwidgets.scientific_spinbox.ScienDSpinBox.assumed_unit_prefix (   self)

This property can fix a default unit prefix that is used for text input.

Returns
: None or prefix string

◆ assumed_unit_prefix() [2/2]

def qtwidgets.scientific_spinbox.ScienDSpinBox.assumed_unit_prefix (   self,
  unit_prefix 
)

This property can fix a default unit prefix that is used for text input.

Parameters
unit_prefixNone or unit prefix in the dictionary

◆ setPrefix()

def qtwidgets.scientific_spinbox.ScienDSpinBox.setPrefix (   self,
  prefix 
)

Set a string to be shown as non-editable prefix in the spinbox.

Parameters
prefixstr, the prefix string to be set

◆ setProperty()

def qtwidgets.scientific_spinbox.ScienDSpinBox.setProperty (   self,
  prop,
  val 
)

For compatibility with QtDesigner.

Somehow the value gets initialized through this method.

Parameters
prop
val

◆ setSingleStep()

def qtwidgets.scientific_spinbox.ScienDSpinBox.setSingleStep (   self,
  step,
  dynamic_stepping = True 
)

Method to set the stepping behaviour of the spinbox (e.g.

when moving the mouse wheel).

   When dynamic_stepping=True the spinbox will perform logarithmic steps according to the
   values' current order of magnitude. The step parameter is then referring to the step size
   relative to the values order of magnitude. Meaning step=0.1 would step increment the second
   most significant digit by one etc.

   When dynamic_stepping=False the step parameter specifies an absolute step size. Meaning each
   time a step is performed this value is added/substracted from the current value.

   For maximum roboustness and consistency it is strongly recommended to pass step as Decimal
   or string in order to be converted lossless to Decimal.

   @param step: Decimal|str, the (relative) step size to set
   @param dynamic_stepping: bool, flag indicating the use of dynamic stepping (True) or
                                  constant stepping (False)

◆ validate()

def qtwidgets.scientific_spinbox.ScienDSpinBox.validate (   self,
  text,
  position 
)

Access method to the validator.

See FloatValidator class for more information.

   @param text: str, string to be validated.
   @param position: int, current text cursor position
   @return: (enum QValidator::State) the returned validator state,
            (str) the input string, (int) the cursor position

◆ value()

def qtwidgets.scientific_spinbox.ScienDSpinBox.value (   self)

Getter method to obtain the current value as float.

Returns
: float, the current value of the SpinBox

◆ valueFromText()

def qtwidgets.scientific_spinbox.ScienDSpinBox.valueFromText (   self,
  text,
  use_assumed_unit_prefix = False 
)

This method is responsible for converting a string displayed in the SpinBox into a Decimal.

The input string is already stripped of prefix and suffix. Just the si-prefix may be present.

Parameters
textstr, the display string to be converted into a numeric value. This string must be conform with the validator.
Returns
: Decimal, the numeric value converted from the input string.

The documentation for this class was generated from the following file: