def show_shortcuts_dialog(self): # The dialog is shown in non-modal form, and consequently must exists # even after this method returns. So we bind the dialog to the # instance to keep pythons GC out of business and manually delete the # dialog once the user closed it self.shortcuts_dialog = KShortcutsDialog( KShortcutsEditor.GlobalAction, KShortcutsEditor.LetterShortcutsDisallowed) self.shortcuts_dialog.addCollection(self.actionCollection()) # delete the dialog manually once the user closed it, to avoid some # mysterious crashes when quitting the application self.shortcuts_dialog.finished.connect( self.shortcuts_dialog.deleteLater) self.shortcuts_dialog.configure()