eric6/HexEdit/HexEditWidget.py

changeset 7366
bd743eacfbca
parent 7360
9190402e4505
child 7628
f904d0eef264
equal deleted inserted replaced
7365:da7e4df94076 7366:bd743eacfbca
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

eric ide

mercurial