Skip to content

Commit 72d623e

Browse files
authored
Explicit modality set when "New..." is selected
The popup that happens for entering a category when "New..." is selected is currently NOT modal, despite line 14 stating "modal=True" I tested it on Ubuntu, Windows 10 and macOS (Big Sur). All of them showed the category dialog and you could put in the background and return to the main calendar window, which wouldn't be the correct behavior. Adding this line before the show command: self.setWindowModality(qtc.Qt.ApplicationModal) Makes it so the Category dialog is modal. Tested on Windows, Ubuntu, and macOS.
1 parent 9aaddfe commit 72d623e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Chapter03/calendar_app.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def __init__(self):
3333
clicked=self.close
3434
)
3535
self.layout().addWidget(self.cancel_btn)
36+
self.setWindowModality(qtc.Qt.ApplicationModal)
3637
self.show()
3738

3839
@qtc.pyqtSlot()

0 commit comments

Comments
 (0)