Relative Content

Tag Archive for pythonpyqt5

How do you make a PyQt5 Child Window with QWidget as a parent modal to the window that called it?

I’m learning PyQt5 and would like to know how to prevent the user from interacting with a parent window when a child window is called. I would like to create the QMainWindow display as a menu, perhaps showing several games the user can play. When the user clicks on the game, a new window opens and the menu is inaccessible. Is there a command for the QtWidgets.QWidget object that will make the window display modal to the calling window whether called by a QMainWindow or nested within another QWidget object?