kopia lustrzana https://github.com/corrscope/corrscope
Reorganize data_bind.py
rodzic
988087c936
commit
4fde1ddf14
|
@ -30,15 +30,15 @@ if TYPE_CHECKING:
|
||||||
|
|
||||||
assert Enum
|
assert Enum
|
||||||
|
|
||||||
__all__ = ["PresentationModel", "map_gui", "behead", "rgetattr", "rsetattr"]
|
__all__ = ["PresentationModel", "map_gui", "behead", "rgetattr", "rsetattr", "Symbol"]
|
||||||
|
|
||||||
|
|
||||||
|
Signal = Any
|
||||||
WidgetUpdater = Callable[[], None]
|
WidgetUpdater = Callable[[], None]
|
||||||
|
|
||||||
|
|
||||||
Symbol = Union[str, "Enum"]
|
Symbol = Union[str, "Enum"]
|
||||||
|
|
||||||
|
|
||||||
|
# Data binding presentation-model
|
||||||
class PresentationModel(qc.QObject):
|
class PresentationModel(qc.QObject):
|
||||||
""" Key-value MVP presentation-model.
|
""" Key-value MVP presentation-model.
|
||||||
|
|
||||||
|
@ -82,7 +82,6 @@ class PresentationModel(qc.QObject):
|
||||||
updater()
|
updater()
|
||||||
|
|
||||||
|
|
||||||
# TODO add tests for recursive operations
|
|
||||||
def map_gui(view: "MainWindow", model: PresentationModel) -> None:
|
def map_gui(view: "MainWindow", model: PresentationModel) -> None:
|
||||||
"""
|
"""
|
||||||
Binding:
|
Binding:
|
||||||
|
@ -106,9 +105,7 @@ def map_gui(view: "MainWindow", model: PresentationModel) -> None:
|
||||||
widget.bind_widget(model, path)
|
widget.bind_widget(model, path)
|
||||||
|
|
||||||
|
|
||||||
Signal = Any
|
# Bound widgets
|
||||||
|
|
||||||
|
|
||||||
class BoundWidget(QWidget):
|
class BoundWidget(QWidget):
|
||||||
default_palette: QPalette
|
default_palette: QPalette
|
||||||
error_palette: QPalette
|
error_palette: QPalette
|
||||||
|
|
Ładowanie…
Reference in New Issue