# Path: Qt.py



from Qt import QtCore, QtWidgets, Qt

    def dragEnterEvent(self, event):
        """dragEnterEvent handler for the EditorSceneBackground."""
        if event.mimeData().hasText():
            event.accept()
            self.update()

    def dragMoveEvent(self, event):
        """dragMoveEvent handler for the EditorSceneBackground."""
        if event.mimeData().hasText():
            tiType, tiId, ox, oy, point = event.mimeData().text().split("#")
            if not tiId.startswith("__EDITOR__"):
                clickPos = QtCore.QPointF(float(ox), float(oy))
                self.editor.moveTrackItem(tiId, event.scenePos(),
                                          clickPos, point)

    def dropEvent(self, event):
        """dropEvent handler for the EditorSceneBackground.
        If the dragged item is already on this scene, it moves the item.
        If the dragged item is dragged from the library scene, a new item is
        created."""
        if event.mimeData().hasText():
            tiType, tiId, ox, oy, point = event.mimeData().text().split("#")
            if tiId.startswith("__EDITOR__"):
                event.setDropAction(Qt.CopyAction)
                event.accept()
                self.editor.createTrackItem(tiType, event.scenePos())
            else:
                event.setDropAction(Qt.MoveAction)
                event.accept()

# Path: Qt.py



# Path: ts2/editor/editorscenebackground.py
from Qt import QtCore, QtWidgets, Qt


    def dragEnterEvent(self, event):
        """dragEnterEvent handler for the EditorSceneBackground."""
        if event.mimeData().hasText():
            event.accept()
            self.update()

    def dragMoveEvent(self, event):
        """dragMoveEvent handler for the EditorSceneBackground."""
        if event.mimeData().hasText():
            tiType, tiId, ox, oy, point = event.mimeData().text().split("#")
            if not tiId.startswith("__EDITOR__"):
                clickPos = QtCore.QPointF(float(ox), float(oy))
                self.editor.moveTrackItem(tiId, event.scenePos(),
                                          clickPos, point)

    def dropEvent(self, event):
        """dropEvent handler for the EditorSceneBackground.
        If the dragged item is already on this scene, it moves the item.
        If the dragged item is dragged from the library scene, a new item is
        created."""
        if event.mimeData().hasText():
            tiType, tiId, ox, oy, point = event.mimeData().text().split("#")
            if tiId.startswith("__EDITOR__"):
                event.setDropAction(Qt.CopyAction)
                event.accept()
                self.editor.createTrackItem(tiType, event.scenePos())
            else:
                event.setDropAction(Qt.MoveAction)
                event.accept()

                clickPos = QtCore.QPointF(float(ox), float(oy))