I have a QDialog object. When the user clicks on the X button or presses Ctrl+Q, I want the dialog to go to a minimized view or system tray icon, instead of closing. How do I do that?
I have a QDialog object. When the user clicks on the X button or
Share
A simple subclass that minimizes instead of closing is the following:
You can test it with this snippet in the interactive interpreter: