Merge pull request #1816 from ntjess/rich-param-cmp

Fix #1814
This commit is contained in:
Ogi Moore 2021-06-02 09:19:28 -07:00 committed by GitHub
commit bd11e5e401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -441,13 +441,13 @@ class Parameter(QtCore.QObject):
def valueIsDefault(self): def valueIsDefault(self):
"""Returns True if this parameter's value is equal to the default value.""" """Returns True if this parameter's value is equal to the default value."""
return self.value() == self.defaultValue() return fn.eq(self.value(), self.defaultValue())
def setLimits(self, limits): def setLimits(self, limits):
"""Set limits on the acceptable values for this parameter. """Set limits on the acceptable values for this parameter.
The format of limits depends on the type of the parameter and The format of limits depends on the type of the parameter and
some parameters do not make use of limits at all.""" some parameters do not make use of limits at all."""
if 'limits' in self.opts and self.opts['limits'] == limits: if 'limits' in self.opts and fn.eq(self.opts['limits'], limits):
return return
self.opts['limits'] = limits self.opts['limits'] = limits
self.sigLimitsChanged.emit(self, limits) self.sigLimitsChanged.emit(self, limits)