from __future__ import annotations
import copy
from typing import Iterator, Union, cast
import pyzx
from PySide6.QtCore import QPointF, QPersistentModelIndex, Qt, \
QModelIndex, QItemSelection, QRect, QSize
from PySide6.QtGui import QVector2D, QFont, QColor, QPainter, QPen, QFontMetrics, QIcon
from PySide6.QtWidgets import QWidget, QToolButton, QHBoxLayout, QListView, \
QStyledItemDelegate, QStyleOptionViewItem, QStyle, QAbstractItemView
from pyzx import VertexType, basicrules
from .common import ET, VT, GraphT, SCALE, pos_from_view, pos_to_view
from .base_panel import BasePanel, ToolbarSection
from .commands import AddRewriteStep, GoToRewriteStep, MoveNodeInStep
from .graphscene import GraphScene
from .graphview import WandTrace, GraphTool
from .eitem import EItem
from .proof import ProofModel
from .utils import get_data
from .vitem import VItem, ZX_GREEN, DragState
from . import proof_actions
from . import animations as anims
class ProofPanel(BasePanel):
"""Panel for the proof mode of ZX live."""
def __init__(self, graph: GraphT) -> None:
self.graph_scene = GraphScene()
self.graph_scene.vertices_moved.connect(self._vert_moved)
# TODO: Right now this calls for every single vertex selected, even if we select many at the same time
self.graph_scene.selectionChanged.connect(self.update_on_selection)
self.graph_scene.vertex_double_clicked.connect(self._vert_double_clicked)
super().__init__(graph, self.graph_scene)
self.init_action_groups()
self.graph_view.wand_trace_finished.connect(self._wand_trace_finished)
self.graph_scene.vertex_dragged.connect(self._vertex_dragged)
self.graph_scene.
Your Task
Complete the code above, taking into account the cross-file context provided.
Your solution must work correctly with the related files in the project.