540 |
540 |
541 @param font font used to show the data |
541 @param font font used to show the data |
542 @type QFont |
542 @type QFont |
543 """ |
543 """ |
544 super().setFont(font) |
544 super().setFont(font) |
545 try: |
545 self.__pxCharWidth = self.fontMetrics().horizontalAdvance("2") |
546 self.__pxCharWidth = self.fontMetrics().horizontalAdvance("2") |
|
547 except AttributeError: |
|
548 self.__pxCharWidth = self.fontMetrics().width("2") |
|
549 self.__pxCharHeight = self.fontMetrics().height() |
546 self.__pxCharHeight = self.fontMetrics().height() |
550 self.__pxGapAdr = self.__pxCharWidth // 2 |
547 self.__pxGapAdr = self.__pxCharWidth // 2 |
551 self.__pxGapAdrHex = self.__pxCharWidth |
548 self.__pxGapAdrHex = self.__pxCharWidth |
552 self.__pxGapHexAscii = 2 * self.__pxCharWidth |
549 self.__pxGapHexAscii = 2 * self.__pxCharWidth |
553 self.__pxCursorWidth = self.__pxCharHeight // 7 |
550 self.__pxCursorWidth = self.__pxCharHeight // 7 |