From: cfalcon <cf...@ce...> - 2016-05-25 14:32:35
|
QWheelEdit setValue method expects to receive a float but a Quantity is given. Use the magnitude when works with Quantity. --- lib/taurus/qt/qtgui/input/qwheel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/taurus/qt/qtgui/input/qwheel.py b/lib/taurus/qt/qtgui/input/qwheel.py index 44985be..d013fa2 100644 --- a/lib/taurus/qt/qtgui/input/qwheel.py +++ b/lib/taurus/qt/qtgui/input/qwheel.py @@ -34,6 +34,7 @@ import math import numpy from taurus.external.qt import Qt +from taurus.external.pint import Q_ class _ArrowButton(Qt.QPushButton): @@ -612,8 +613,10 @@ class QWheelEdit(Qt.QFrame): Sets the value of this widget. Send a 'valueChanged(double)' Qt signal - @param[in] v (float) the value to be set + @param[in] v (float/Quantity) the value to be set """ + if isinstance(v, Q_): + v = v.magnitude self._setValue(v) self._updateValue(trigValueEdited=False) -- 2.4.0 |