A simple test of using QGraphicsScene

I use this mainly for reference, which Q-class is in which module.
visu_broken
LEdoian 2 years ago
parent 2ddce6e089
commit c500a97fa6

@ -0,0 +1,25 @@
#!/usr/bin/env python3
from PySide6 import QtCore, QtGui, QtWidgets
class Window(QtWidgets.QWidget):
def __init__(self):
super().__init__()
scene = QtWidgets.QGraphicsScene()
rect = scene.addRect(QtCore.QRectF(100,100,100,100),
pen=QtGui.QPen(QtGui.QColor('red')),
brush=QtGui.QBrush(QtGui.QColor('yellow')),
)
view = QtWidgets.QGraphicsView(scene)
self.scene = scene
self.view = view
self.rect = rect
view.show()
app = QtWidgets.QApplication([])
win = Window()
#win.show()
app.exec()
Loading…
Cancel
Save