(self, event)
onmousemove
onmousemove
onmousemove
def mouseMoveEvent(self, event):
        """ onmousemove
        """
        loc_x = event.pos().x()
        loc_y = event.pos().y()

        # mouse in header - change to arrow
        if 0 <= loc_y <= self._header_height:
            if self._hover_lines:
                self._hovered_line = -1
                self.viewport().update(
                    QRect(0, 0,
                          self.viewport().width(),
                          (self._char_height * 3) + self._header_height))
            self.viewport().setCursor(Qt.ArrowCursor)
        else:
            self.viewport().setCursor(Qt.IBeamCursor)

        if self.data is None:
            return

        if loc_y > self._header_height:
            if self._hover_lines:
                self._hovered_line = self.pixel_to_line(loc_x, loc_y)
                self.viewport().update()  # todo: optimize redraw rect

        if self.data:
            show = False
            if loc_y > self._header_height + self._ver_spacing:
                if (self._hex_start - self._hor_spacing) < loc_x < self._ascii_start:
                    coord_x, coord_y = self.pixel_to_data(
                        loc_x - self._hex_start, loc_y)
                    line = int(ceil(coord_x - (coord_x / 3)))
                    index = int(
                        floor(self.pos + line / 2
                              + coord_y * self.bytes_per_line))
                    show = True
                elif self._ascii_start < loc_x < self._ascii_start + self._ascii_width:
                    coord_x, coord_y = self.pixel_to_data(
                        loc_x - self._ascii_start, loc_y)
                    line = int(ceil(coord_x % self.bytes_per_line))
                    index = int(
                        floor(self.pos + line +
                              coord_y * self.bytes_per_line))
                    show = True

                if show:
                    if self.is_64bit_address:
                        txt = 'Address: 0x{0:016X}'.format(index + self.base)
                    else:
                        txt = 'Address: 0x{0:08X}'.format(index + self.base)
                    if txt:
                        self.statusChanged.emit(txt)

        if self._is_selecting:
            self.selection.start = self.caret.position
            new_caret = self.pixel_to_caret(loc_x, loc_y)
            if new_caret is None:
                return
            self.selection.end = new_caret.position
            if self.selection.end > len(self.data):
                self.selection.end = len(self.data)
            self.selection.active = True
            self._force_repaint(True)
            self.selectionChanged.emit()
def mouseMoveEvent ( self , event ) : loc_x = event . pos ( ) . x ( ) loc_y = event . pos ( ) . y ( ) # mouse in header - change to arrow if 0 <= loc_y <= self . _header_height : if self . _hover_lines : self . _hovered_line = - 1 self . viewport ( ) . update ( QRect ( 0 , 0 , self . viewport ( ) . width ( ) , ( self . _char_height * 3 ) + self . _header_height ) ) self . viewport ( ) . setCursor ( Qt . ArrowCursor ) else : self . viewport ( ) . setCursor ( Qt . IBeamCursor ) if self . data is None : return if loc_y > self . _header_height : if self . _hover_lines : self . _hovered_line = self . pixel_to_line ( loc_x , loc_y ) self . viewport ( ) . update ( ) # todo: optimize redraw rect if self . data : show = False if loc_y > self . _header_height + self . _ver_spacing : if ( self . _hex_start - self . _hor_spacing ) < loc_x < self . _ascii_start : coord_x , coord_y = self . pixel_to_data ( loc_x - self . _hex_start , loc_y ) line = int ( ceil ( coord_x - ( coord_x / 3 ) ) ) index = int ( floor ( self . pos + line / 2 + coord_y * self . bytes_per_line ) ) show = True elif self . _ascii_start < loc_x < self . _ascii_start + self . _ascii_width : coord_x , coord_y = self . pixel_to_data ( loc_x - self . _ascii_start , loc_y ) line = int ( ceil ( coord_x % self . bytes_per_line ) ) index = int ( floor ( self . pos + line + coord_y * self . bytes_per_line ) ) show = True if show : if self . is_64bit_address : txt = 'Address: 0x{0:016X}' . format ( index + self . base ) else : txt = 'Address: 0x{0:08X}' . format ( index + self . base ) if txt : self . statusChanged . emit ( txt ) if self . _is_selecting : self . selection . start = self . caret . position new_caret = self . pixel_to_caret ( loc_x , loc_y ) if new_caret is None : return self . selection . end = new_caret . position if self . selection . end > len ( self . data ) : self . selection . end = len ( self . data ) self . selection . active = True self . _force_repaint ( True ) self . selectionChanged . emit ( )