(self, pos)
ContextMenu
ContextMenu
ContextMenu
def _on_contextmenu(self, pos):
        """ ContextMenu
        """
        index = self.indexAt(pos).row()
        glbl_pt = self.mapToGlobal(pos)
        context_menu = QMenu(self)
        if index != -1:
            mem_prot = self._ranges_model.item(index, 2).text()
            # is readable
            if 'r' in mem_prot:
                context_menu.addAction(
                    'Dump Binary', lambda: self._on_dumprange(
                        self._ranges_model.item(index, 0).text(),
                        self._ranges_model.item(index, 1).text()))
                context_menu.addSeparator()

            context_menu.addAction(
                'Add Watchpoint', lambda: self._on_addwatchpoint(
                    self._ranges_model.item(index, 0).text()))

            context_menu.addAction(
                'Copy address', lambda: utils.copy_hex_to_clipboard(
                    self._ranges_model.item(index, 0).text()))
            context_menu.addSeparator()

            if self._ranges_model.item(index, 5):
                file_path = self._ranges_model.item(index, 5).text()
                if file_path:
                    context_menu.addAction(
                        'Copy Path', lambda: utils.copy_str_to_clipboard(
                            file_path))
                    context_menu.addSeparator()
                    if self._app_window.dwarf._platform == 'linux':
                        context_menu.addAction(
                            'Show ELF Info', lambda: self._on_parse_elf(
                                file_path))
                        context_menu.addSeparator()

            if self.search_enabled:
                context_menu.addSeparator()
                context_menu.addAction('Search', self._on_cm_search)
                context_menu.addSeparator()

        context_menu.addAction('Refresh', self.update_ranges)
        context_menu.exec_(glbl_pt)
def _on_contextmenu ( self , pos ) : index = self . indexAt ( pos ) . row ( ) glbl_pt = self . mapToGlobal ( pos ) context_menu = QMenu ( self ) if index != - 1 : mem_prot = self . _ranges_model . item ( index , 2 ) . text ( ) # is readable if 'r' in mem_prot : context_menu . addAction ( 'Dump Binary' , lambda : self . _on_dumprange ( self . _ranges_model . item ( index , 0 ) . text ( ) , self . _ranges_model . item ( index , 1 ) . text ( ) ) ) context_menu . addSeparator ( ) context_menu . addAction ( 'Add Watchpoint' , lambda : self . _on_addwatchpoint ( self . _ranges_model . item ( index , 0 ) . text ( ) ) ) context_menu . addAction ( 'Copy address' , lambda : utils . copy_hex_to_clipboard ( self . _ranges_model . item ( index , 0 ) . text ( ) ) ) context_menu . addSeparator ( ) if self . _ranges_model . item ( index , 5 ) : file_path = self . _ranges_model . item ( index , 5 ) . text ( ) if file_path : context_menu . addAction ( 'Copy Path' , lambda : utils . copy_str_to_clipboard ( file_path ) ) context_menu . addSeparator ( ) if self . _app_window . dwarf . _platform == 'linux' : context_menu . addAction ( 'Show ELF Info' , lambda : self . _on_parse_elf ( file_path ) ) context_menu . addSeparator ( ) if self . search_enabled : context_menu . addSeparator ( ) context_menu . addAction ( 'Search' , self . _on_cm_search ) context_menu . addSeparator ( ) context_menu . addAction ( 'Refresh' , self . update_ranges ) context_menu . exec_ ( glbl_pt )