def __init__(self, engine, menu_name):
        self._engine = engine
        self._menu_name = menu_name
        self._dialogs = []

        self._widget = QtWidgets.QWidget()
        self._handle = QtWidgets.QMenu(self._menu_name, self._widget)
        self._ui_cache = []
    def _add_menu_item(self, name, parent_menu, callback, properties=None):
        action = QtWidgets.QAction(name, parent_menu)
        parent_menu.addAction(action)
        action.triggered.connect(callback)

        if properties:
            if "tooltip" in properties:
                action.setTooltip(properties["tooltip"])
                action.setStatustip(properties["tooltip"])
            if "enable_callback" in properties:
                action.setEnabled(properties["enable_callback"]())

        return action
 def _add_sub_menu(self, menu_name, parent_menu):
     sub_menu = QtWidgets.QMenu(title=menu_name, parent=parent_menu)
     parent_menu.addMenu(sub_menu)
     return sub_menu
 def _add_divider(self, parent_menu):
     divider = QtWidgets.QAction(parent_menu)
     divider.setSeparator(True)
     parent_menu.addAction(divider)
     return divider