'Set the value of this SpinBox.
If the value is out of bounds, it will be clipped to the nearest boundary
or wrapped if wrapping is enabled.
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)'

def setValue(self, value=None, update=True, delaySignal=False):

    if (value is None):
        value = self.value()
    bounds = self.opts['bounds']
    if ((None not in bounds) and (self.opts['wrapping'] is True)):
        value = float(value)
        (l, u) = (float(bounds[0]), float(bounds[1]))
        value = (((value - l) % (u - l)) + l)
    else:
        if ((bounds[0] is not None) and (value < bounds[0])):
            value = bounds[0]
        if ((bounds[1] is not None) and (value > bounds[1])):
            value = bounds[1]
    if self.opts['int']:
        value = int(value)
    if (not isinstance(value, D)):
        value = D(asUnicode(value))
    if (value == self.val):
        return
    prev = self.val
    self.val = value
    if update:
        self.updateText(prev=prev)
    self.sigValueChanging.emit(self, float(self.val))
    if (not delaySignal):
        self.emitChanged()
    return value
