Skip to content

Files

Latest commit

76ccc61 · Dec 30, 2021

History

History
45 lines (25 loc) · 2.38 KB

pygame_and_othere_libraries.md

File metadata and controls

45 lines (25 loc) · 2.38 KB

StackOverflow            reply.it reply.it


PyGame in combination with other libraries

PySimpleGUI

PySimpleGUI

Related Stack Overflow questions:

PygameMenu

pygame-menu

MathPlotLib

mathplotlib

Related Stack Overflow questions:

PyQt

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.