Width and height are the width and height of the widget. The first line moves the origin of the coordinate system of the painter to the centre of the widget. The second line scales the coordinate system so that it has a range of (-335, 335). In the end all operations are done using coordinates ranging from -335 to +335 with the (0,0) located in the middle of the widget.