Files
sphere-grid/grid/ui/window.py
Alexandre RIO a563a01ca3
All checks were successful
CI/CD / wol (push) Successful in 12s
CI/CD / build (push) Successful in 9m25s
fix: multi pattern position
2025-08-23 14:54:04 +02:00

50 lines
1.0 KiB
Python

import logging
import sys
from PySide6.QtGui import QPainter
from PySide6.QtWidgets import (
QApplication,
QGraphicsScene,
QGraphicsView,
QHBoxLayout,
QWidget,
)
from grid.ui.pattern import Pattern
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 = Pattern(0, 0)
pp2 = Pattern(401, 0)
pp3 = Pattern(0, 401)
pp4 = Pattern(401, 401)
self.scene.addItem(pp1)
self.scene.addItem(pp2)
self.scene.addItem(pp3)
self.scene.addItem(pp4)
view = QGraphicsView(self.scene)
view.setRenderHint(QPainter.RenderHint.Antialiasing)
vbox = QHBoxLayout(self)
vbox.addWidget(view)
self.setLayout(vbox)
self.show()
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
)
app = QApplication(sys.argv)
w = Window()
app.exec()