pyqt_reactive.widgets

Extended widget implementations.

Specialized widget subclasses that build on the protocol layer with enhanced behavior.

class pyqt_reactive.widgets.NoScrollSpinBox(parent=None)[source]

SpinBox that ignores wheel events to prevent accidental value changes.

Inherits from SpinBoxAdapter which already implements ValueGettable/ValueSettable ABCs.

wheelEvent(event: QWheelEvent)[source]

Ignore wheel events to prevent accidental value changes.

class pyqt_reactive.widgets.NoScrollDoubleSpinBox(parent=None)[source]

DoubleSpinBox that ignores wheel events to prevent accidental value changes.

Inherits from DoubleSpinBoxAdapter which already implements ValueGettable/ValueSettable ABCs.

wheelEvent(event: QWheelEvent)[source]

Ignore wheel events to prevent accidental value changes.

textFromValue(value: float) str[source]

Convert value to string without trailing zeros for clean display.

Users can still type additional digits when editing - this only affects the display format, not the underlying precision.

Examples

1.5 -> “1.5” 1.0 -> “1” 1.567 -> “1.567” 0.0001 -> “0.0001”

class pyqt_reactive.widgets.NoScrollComboBox(parent=None, placeholder='')[source]

ComboBox that ignores wheel events to prevent accidental value changes.

Inherits from ComboBoxAdapter which already implements ValueGettable/ValueSettable ABCs. Supports placeholder text when currentIndex == -1 (for None values).

__init__(parent=None, placeholder='')[source]
wheelEvent(event: QWheelEvent)[source]

Ignore wheel events to prevent accidental value changes.

setPlaceholder(text: str)[source]

Set the placeholder text shown when currentIndex == -1.

setCurrentIndex(index: int)[source]

Override to track when placeholder should be active.

get_value()[source]

Get current value (item data at current index).

set_value(value)[source]

Set current value by finding matching item data.

paintEvent(event)[source]

Override to draw placeholder text when currentIndex == -1.

class pyqt_reactive.widgets.NoneAwareCheckBox(parent=None)[source]

QCheckBox that supports None state for lazy dataclass contexts.

Shows inherited value as grayed placeholder when value is None. Clicking converts placeholder to explicit value.

__init__(parent=None)[source]
get_value()[source]

Get value, returning None if in placeholder state.

is_placeholder() bool[source]

Return whether the checkbox is currently displaying inherited state.

set_value(value)[source]

Set value, handling None by leaving in placeholder state.

set_placeholder_preview(checked: bool) None[source]

Display an inherited checkbox value without making it concrete.

convert_placeholder_to_concrete() None[source]

Keep the displayed value but mark it as a user-controlled value.

clear_placeholder_cache() None[source]

Clear cached placeholder text set by the placeholder enhancer.

mousePressEvent(event)[source]

On click, switch from placeholder to explicit value.

paintEvent(event)[source]

Draw with placeholder styling.

For placeholder state, draw the checkbox with grey text color to make the checkmark appear dimmed.

class pyqt_reactive.widgets.StatusIndicator(check_fn: Callable[[], Tuple[bool, str]] = None, color_scheme: ColorScheme = None, show_refresh: bool = True, debounce_ms: int = 2000, parent=None)[source]

Reusable status indicator with colored dot, label, and refresh button.

Usage:
indicator = StatusIndicator(

check_fn=lambda: my_service.test_connection(), color_scheme=self.color_scheme, parent=self

) layout.addWidget(indicator)

# check_fn returns Tuple[bool, str]: (is_ok, status_message) # True → CONNECTED state, False → DISCONNECTED state

__init__(check_fn: Callable[[], Tuple[bool, str]] = None, color_scheme: ColorScheme = None, show_refresh: bool = True, debounce_ms: int = 2000, parent=None)[source]
set_state(state: StatusState, message: str = None)[source]

Update visual state.

refresh(force: bool = False)[source]

Trigger async status check.

showEvent(event)[source]

Auto-refresh on show (no debounce for initial check).

closeEvent(event)[source]

Cleanup on close.

class pyqt_reactive.widgets.StatusState(*values)[source]

Status indicator states — colors resolved from color scheme at runtime.

UNKNOWN = 'Unknown'
CHECKING = 'Checking...'
CONNECTED = 'connected'
DISCONNECTED = 'disconnected'
WARNING = 'warning'
property default_message: str | None
pyqt_reactive.widgets.get_status_color(state: StatusState, color_scheme: ColorScheme) str[source]

Resolve status state to color from scheme.

Modules

editors

Editor widgets - code editors, text editors, etc.

enhanced_path_widget

Enhanced Path Widget for PyQt6 GUI

llm_chat_panel

LLM Chat Panel Widget

mixins

PyQt6 Widget Utilities

no_scroll_spinbox

No-scroll spinbox widgets for PyQt6.

shared

Shared widget utilities and components.

status_bar

Status Bar Widget for PyQt6

status_indicator

Reusable status indicator widget with colored dot, label, and refresh button.