QRotaryEncoder#

class QInstrument.widgets.QRotaryEncoder.QRotaryEncoder(*args, steps=None, **kwargs)[source]#

Bases: QDial

QDial subclass that emits directional step signals.

Wraps the full dial range and emits stepUp or stepDown each time the user turns the dial by one step, correctly handling wrap-around.

Properties#

stepsint

Number of discrete steps in one full turn. Default: 100.

Signals#

stepUp

Emitted each time the dial turns one step clockwise.

stepDown

Emitted each time the dial turns one step counter-clockwise.

setSteps(value)[source]#

Set the number of steps in one full turn.

Parameters:

value (int) – Number of discrete steps. Sets the dial maximum to value - 1 so that the range is [0, value - 1].

Return type:

None

steps()[source]#

Return the number of steps in one full turn.

Return type:

int