from __future__ import annotations

from typing import TYPE_CHECKING

from PySide6.QtWidgets import QWidget

if TYPE_CHECKING:
    from bsmu.vision.core.data import Data


class DataViewer(QWidget):
    def __init__(self, data: Data = None, parent: QWidget = None):
        super().__init__(parent)

        self._data = None
        self.data = data

    @property
    def data(self) -> Data:
        return self._data

    @data.setter
    def data(self, value: Data):
        if self._data != value:
            self._on_data_changing()
            self._data = value
            self._on_data_changed()

    @property
    def data_path_name(self):
        return '' if self.data is None else self.data.path_name

    def _on_data_changing(self):
        pass

    def _on_data_changed(self):
        pass

9867132c79197cb8c4d685fe19d1c2bc93c646e5
<mask token>


class DataViewer(QWidget):

    def __init__(self, data: Data=None, parent: QWidget=None):
        super().__init__(parent)
        self._data = None
        self.data = data
    <mask token>

    @data.setter
    def data(self, value: Data):
        if self._data != value:
            self._on_data_changing()
            self._data = value
            self._on_data_changed()
    <mask token>
    <mask token>
    <mask token>

<mask token>


class DataViewer(QWidget):

    def __init__(self, data: Data=None, parent: QWidget=None):
        super().__init__(parent)
        self._data = None
        self.data = data
    <mask token>

    @data.setter
    def data(self, value: Data):
        if self._data != value:
            self._on_data_changing()
            self._data = value
            self._on_data_changed()

    @property
    def data_path_name(self):
        return '' if self.data is None else self.data.path_name

    def _on_data_changing(self):
        pass

    def _on_data_changed(self):
        pass

<mask token>


class DataViewer(QWidget):

    def __init__(self, data: Data=None, parent: QWidget=None):
        super().__init__(parent)
        self._data = None
        self.data = data

    @property
    def data(self) ->Data:
        return self._data

    @data.setter
    def data(self, value: Data):
        if self._data != value:
            self._on_data_changing()
            self._data = value
            self._on_data_changed()

    @property
    def data_path_name(self):
        return '' if self.data is None else self.data.path_name

    def _on_data_changing(self):
        pass

    def _on_data_changed(self):
        pass

<mask token>
if TYPE_CHECKING:
    from bsmu.vision.core.data import Data


class DataViewer(QWidget):

    def __init__(self, data: Data=None, parent: QWidget=None):
        super().__init__(parent)
        self._data = None
        self.data = data

    @property
    def data(self) ->Data:
        return self._data

    @data.setter
    def data(self, value: Data):
        if self._data != value:
            self._on_data_changing()
            self._data = value
            self._on_data_changed()

    @property
    def data_path_name(self):
        return '' if self.data is None else self.data.path_name

    def _on_data_changing(self):
        pass

    def _on_data_changed(self):
        pass

from __future__ import annotations

from typing import TYPE_CHECKING

from PySide6.QtWidgets import QWidget

if TYPE_CHECKING:
    from bsmu.vision.core.data import Data


class DataViewer(QWidget):
    def __init__(self, data: Data = None, parent: QWidget = None):
        super().__init__(parent)

        self._data = None
        self.data = data

    @property
    def data(self) -> Data:
        return self._data

    @data.setter
    def data(self, value: Data):
        if self._data != value:
            self._on_data_changing()
            self._data = value
            self._on_data_changed()

    @property
    def data_path_name(self):
        return '' if self.data is None else self.data.path_name

    def _on_data_changing(self):
        pass

    def _on_data_changed(self):
        pass
