Related Stack Overflow questions:
Related Stack Overflow questions:
Related Stack Overflow questions:
Fist of all do not mix frameworks. The frameworks may interact poorly or completely conflict with one another. Getting it to work on your system doesn't mean it will work on another system or with a different version of any of the frameworks. Mixing frameworks always means some kind of undefined behavior.
In your example your create an image (pygae.Surface) with the Pygame library and display it in QWidget
.
You never create a Pygame window. Therefore the Pygame event handling cannot work. You need to use Qts event handling.
Anyway, if you just want to do some image processing or draw some pictures and display them in a Qt application, I suggest using OpenCV (cv2). This library is designed for powerful image manipulation and the images can be viewed nicely using a Qt user interface.