Files
sphere-grid/grid/ui/window.py

33 lines
770 B
Python

from PySide6.QtGui import QPainter
from PySide6.QtWidgets import (
QGraphicsScene,
QGraphicsView,
QHBoxLayout,
QWidget,
)
from grid.ui.pattern import LargeUltimaPattern, SmallZPattern
class Window(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("sphere grid")
self.setGeometry(0, 0, 800, 600)
self.scene = QGraphicsScene(0, 0, 400, 400)
pp1 = LargeUltimaPattern(0, 0)
pp2 = SmallZPattern(401, 0)
self.scene.addItem(pp1)
self.scene.addItem(pp2)
view = QGraphicsView(self.scene)
view.setRenderHint(QPainter.RenderHint.Antialiasing)
vbox = QHBoxLayout(self)
vbox.addWidget(view)
self.setLayout(vbox)
self.show()