mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
14 lines
299 B
Python
14 lines
299 B
Python
from collections.abc import Iterator
|
|
from contextlib import contextmanager
|
|
|
|
from PySide6.QtWidgets import QWidget
|
|
|
|
|
|
@contextmanager
|
|
def block_signals(widget: QWidget) -> Iterator[None]:
|
|
blocked = widget.blockSignals(True)
|
|
try:
|
|
yield
|
|
finally:
|
|
widget.blockSignals(blocked)
|