Skip to content

Latest commit

 

History

History
9 lines (5 loc) · 809 Bytes

File metadata and controls

9 lines (5 loc) · 809 Bytes

QPainter Python example

This example application demonstrates how you can use QPainter to perform custom rendering in a widget. It turns the text editor from example 7 into an action shooter: When you click inside the editor with the mouse, bullet holes appear.

QPainter Python Example

The crucial steps of this example are to override mousePressEvent(...) to handle the user's clicks, and paintEvent(...) to draw the bullets. See the top of main.py for how these features work in detail.

To run this example yourself, please follow these instructions.