eric6/HexEdit/HexEditWidget.py

changeset 7366
bd743eacfbca
parent 7360
9190402e4505
child 7628
f904d0eef264
--- a/eric6/HexEdit/HexEditWidget.py	Wed Jan 08 18:57:10 2020 +0100
+++ b/eric6/HexEdit/HexEditWidget.py	Wed Jan 08 18:58:31 2020 +0100
@@ -612,7 +612,10 @@
         @type QFont
         """
         super(HexEditWidget, self).setFont(font)
-        self.__pxCharWidth = self.fontMetrics().width("2")
+        try:
+            self.__pxCharWidth = self.fontMetrics().horizontalAdvance("2")
+        except AttributeError:
+            self.__pxCharWidth = self.fontMetrics().width("2")
         self.__pxCharHeight = self.fontMetrics().height()
         self.__pxGapAdr = self.__pxCharWidth // 2
         self.__pxGapAdrHex = self.__pxCharWidth

eric ide

mercurial