The addRect function in PyQt5.QtWidgets.QGraphicsScene is used to add a rectangular shape to the scene. This function takes in the coordinates and dimensions of the rectangle and returns a QGraphicsRectItem object representing the rectangle in the scene. This allows the rectangle to be displayed and interacted with in the graphics scene.
Python QGraphicsScene.addRect - 33 examples found. These are the top rated real world Python examples of PyQt5.QtWidgets.QGraphicsScene.addRect extracted from open source projects. You can rate examples to help us improve the quality of examples.