610 |
610 |
611 @param font font used to show the data |
611 @param font font used to show the data |
612 @type QFont |
612 @type QFont |
613 """ |
613 """ |
614 super(HexEditWidget, self).setFont(font) |
614 super(HexEditWidget, self).setFont(font) |
615 self.__pxCharWidth = self.fontMetrics().width("2") |
615 try: |
|
616 self.__pxCharWidth = self.fontMetrics().horizontalAdvance("2") |
|
617 except AttributeError: |
|
618 self.__pxCharWidth = self.fontMetrics().width("2") |
616 self.__pxCharHeight = self.fontMetrics().height() |
619 self.__pxCharHeight = self.fontMetrics().height() |
617 self.__pxGapAdr = self.__pxCharWidth // 2 |
620 self.__pxGapAdr = self.__pxCharWidth // 2 |
618 self.__pxGapAdrHex = self.__pxCharWidth |
621 self.__pxGapAdrHex = self.__pxCharWidth |
619 self.__pxGapHexAscii = 2 * self.__pxCharWidth |
622 self.__pxGapHexAscii = 2 * self.__pxCharWidth |
620 self.__pxCursorWidth = self.__pxCharHeight // 7 |
623 self.__pxCursorWidth = self.__pxCharHeight // 7 |