One catch to syncing a QSlider or QDial to a QDoubleSpinBox is that when the QDoubleSpinBox updates the QDial or QSlider, the QDial or QSlider valueChanged signal will be triggered causing them to update the QDoubleSpinBox in return. This causes an issue where you cannot enter decimal values into the QDoubleSpinBox, because when you enter a decimal ".", the QDial/Slider update overwrites the decimal, blocking you from entering the rest of the decimal value.
To fix this, have each input widget check if their value already matches the value in the widget they are writing to, and if they do, then do not update the value. Here is an example of a function that allows a QDial and QDoubleSpinBox to update each other:
def syncDialAndSpinbox(self, widget_in, widget_out):
if isinstance(widget_in, QtWidgets.QDial):
value = float(widget_in.value())*100.0/float(widget_in.maximum())
out_value = widget_out.value()
else:
value = round(widget_in.value()*widget_out.maximum()/100)
out_value = widget_out.value()
if value != out_value:
widget_out.setValue(value)
In this example, the QDoubleSpinBox is a percentage (0.0-100.0) and the QDial has 100,000 steps to support a float output of percentages to three decimal places (0.000% to 100.000%).