# Path: Qt.py

# 
# Path: ts2/editor/delegates.py
# class ServicesDelegate(QtWidgets.QStyledItemDelegate):
# class TrainTypesDelegate(QtWidgets.QStyledItemDelegate):
# class PlacesDelegate(QtWidgets.QStyledItemDelegate):
# class PropertyValuesDelegate(QtWidgets.QStyledItemDelegate):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):


from Qt import QtCore, QtGui, QtWidgets, Qt
from ts2.editor import delegates

    def selectionChanged(self, selected, deselected):
        """Called when the user changes the selection. Emits the
        trainSelected signal"""
        super().selectionChanged(selected, deselected)
        if selected.indexes():
            index = selected.indexes()[0]
            if index.isValid():
                self.trainSelected.emit(self.model().index(index.row(), 0).data())

    def setModel(self, model):
        """Sets model and also setup cols"""
        super().setModel(model)
        self.resizeColumnsToContents()


class TrainsGraphicsView(QtWidgets.QGraphicsView):
    """Graphics view with specific options for editing train positions in the
    editor
    """
    def __init__(self, parent):
        """Constructor for the TrainsGraphicsView class"""
        super().__init__(parent)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setVerticalStretch(1)
        self.setInteractive(True)
        self.setRenderHint(QtGui.QPainter.Antialiasing, False)
        self.setDragMode(QtWidgets.QGraphicsView.ScrollHandDrag)
        self.setAcceptDrops(True)

# Path: Qt.py

# 
# Path: ts2/editor/delegates.py
# class ServicesDelegate(QtWidgets.QStyledItemDelegate):
# class TrainTypesDelegate(QtWidgets.QStyledItemDelegate):
# class PlacesDelegate(QtWidgets.QStyledItemDelegate):
# class PropertyValuesDelegate(QtWidgets.QStyledItemDelegate):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):
#     def createEditor(self, parent, option, index):
#     def setEditorData(self, editor, index):
#     def setModelData(self, editor, model, index):
#     def updateEditorGeometry(self, editor, option, index):


# Path: ts2/editor/views.py
from Qt import QtCore, QtGui, QtWidgets, Qt
from ts2.editor import delegates


    def selectionChanged(self, selected, deselected):
        """Called when the user changes the selection. Emits the
        trainSelected signal"""
        super().selectionChanged(selected, deselected)
        if selected.indexes():
            index = selected.indexes()[0]
            if index.isValid():
                self.trainSelected.emit(self.model().index(index.row(), 0).data())

    def setModel(self, model):
        """Sets model and also setup cols"""
        super().setModel(model)
        self.resizeColumnsToContents()


class TrainsGraphicsView(QtWidgets.QGraphicsView):
    """Graphics view with specific options for editing train positions in the
    editor
    """
    def __init__(self, parent):
        """Constructor for the TrainsGraphicsView class"""
        super().__init__(parent)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setVerticalStretch(1)
        self.setInteractive(True)
        self.setRenderHint(QtGui.QPainter.Antialiasing, False)
        self.setDragMode(QtWidgets.QGraphicsView.ScrollHandDrag)
        self.setAcceptDrops(True)

        self.setBackgroundBrush(QtGui.QBrush(Qt.black))