Coverage for openhcs/pyqt_gui/widgets/shared/no_scroll_spinbox.py: 0.0%
11 statements
« prev ^ index » next coverage.py v7.10.3, created at 2025-08-14 05:57 +0000
« prev ^ index » next coverage.py v7.10.3, created at 2025-08-14 05:57 +0000
1"""
2No-scroll spinbox widgets for PyQt6.
4Prevents accidental value changes from mouse wheel events.
5"""
7from PyQt6.QtWidgets import QSpinBox, QDoubleSpinBox, QComboBox
8from PyQt6.QtGui import QWheelEvent
11class NoScrollSpinBox(QSpinBox):
12 """SpinBox that ignores wheel events to prevent accidental value changes."""
14 def wheelEvent(self, event: QWheelEvent):
15 """Ignore wheel events to prevent accidental value changes."""
16 event.ignore()
19class NoScrollDoubleSpinBox(QDoubleSpinBox):
20 """DoubleSpinBox that ignores wheel events to prevent accidental value changes."""
22 def wheelEvent(self, event: QWheelEvent):
23 """Ignore wheel events to prevent accidental value changes."""
24 event.ignore()
27class NoScrollComboBox(QComboBox):
28 """ComboBox that ignores wheel events to prevent accidental value changes."""
30 def wheelEvent(self, event: QWheelEvent):
31 """Ignore wheel events to prevent accidental value changes."""
32 event.ignore()