mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Need to store a python reference to the menu on the action to avoid the menu being deleted in case it is not stored anywhere else
This commit is contained in:
parent
a8ba150cb8
commit
7fe3d006d8
@ -34,7 +34,12 @@ QMessageBox.exec_ = QMessageBox.exec
|
||||
|
||||
|
||||
# Restore ability to associate a menu with an action
|
||||
QAction.setMenu = lambda self, menu: progress_indicator.set_menu_on_action(self, menu)
|
||||
def set_menu(self, menu):
|
||||
self.keep_menu_ref = menu
|
||||
progress_indicator.set_menu_on_action(self, menu)
|
||||
|
||||
|
||||
QAction.setMenu = set_menu
|
||||
QAction.menu = lambda self: progress_indicator.menu_for_action(self)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user