You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
522 B
Python
26 lines
522 B
Python
2 years ago
|
#!/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()
|