QRotaryEncoderSpinBox#
- class QInstrument.widgets.QRotaryEncoderSpinBox.QRotaryEncoderSpinBox(*args, colors=None, **kwargs)[source]#
Bases:
QWidgetQDoubleSpinBox controlled by a rotary encoder dial.
Combines a
QRotaryEncoderdial and aQDoubleSpinBoxinto a single widget. Turning the dial steps the spinbox value up or down. The spinbox background color interpolates between two colors as the value moves from minimum to maximum.- Parameters:
colors (tuple[str, str] | None) – Background color interpolates from
colors[0]at minimum tocolors[1]at maximum. Accepts any color string recognized byQColor(e.g.'white','#68ff00'). Default:('white', 'red').The following ``QDoubleSpinBox`` methods are delegated
directly
``decimals``, ``setDecimals``, ``maximum``, ``minimum``,
``prefix``, ``setPrefix``, ``suffix``, ``setSuffix``,
``singleStep``, ``setSingleStep``, ``stepType``,
``setStepType``, ``value``, ``setValue``, ``valueChanged``.
- sizeHint()[source]#
Return the preferred size for the widget.
Provides a compact default so that the widget does not expand aggressively in parent layouts. The dial scales smoothly to whatever space it is actually allocated.
- Return type:
QSize
- setTitle(text)[source]#
Set the title label text displayed above the spinbox.
- Parameters:
text (str) – Label text. Pass an empty string to hide the label.
- Return type:
- setColors(colors)[source]#
Set the spinbox background color gradient.
Idempotent: safe to call multiple times with the same or different colors without double-connecting the update slot.
- Parameters:
colors (tuple[str, str] | None) –
(low_color, high_color)pair, orNoneto disable color interpolation.- Return type: