Skip to content

Commit 2cf926c

Browse files
Define hardcoded positions for nodes and draw circles with labels
1 parent 8eb8869 commit 2cf926c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ZKP_Demo_Tool/zkp_gui_game.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import sys
2+
from PyQt5.QtWidgets import (
3+
QApplication, QMainWindow, QWidget, QPushButton, QVBoxLayout,
4+
QHBoxLayout, QLabel, QComboBox, QGraphicsView, QGraphicsScene, QTextEdit
5+
)
6+
from PyQt5.QtGui import QPen, QBrush, QColor
7+
from PyQt5.QtCore import Qt, QPointF
8+
class DummyGraph:
9+
def __init__(self):
10+
self.vertices = ['A', 'B', 'C', 'D']
11+
self.edge_weights = {('A', 'B'): 2, ('B', 'C'): 3, ('C', 'D'): 4, ('A', 'D'): 10}
12+
graph = DummyGraph()
13+
14+
class GraphCanvas(QGraphicsView):
15+
def __init__(self, graph):
16+
super().__init__()
17+
self.graph = graph
18+
self.scene = QGraphicsScene()
19+
self.setScene(self.scene)
20+
self.draw_graph()

0 commit comments

Comments
 (0)