eric6/WebBrowser/CookieJar/CookieExceptionsModel.py

changeset 7366
bd743eacfbca
parent 7360
9190402e4505
child 7781
607a6098cb44
--- a/eric6/WebBrowser/CookieJar/CookieExceptionsModel.py	Wed Jan 08 18:57:10 2020 +0100
+++ b/eric6/WebBrowser/CookieJar/CookieExceptionsModel.py	Wed Jan 08 18:58:31 2020 +0100
@@ -47,8 +47,12 @@
         if role == Qt.SizeHintRole:
             fm = QFontMetrics(QFont())
             height = fm.height() + fm.height() // 3
-            width = fm.width(
-                self.headerData(section, orientation, Qt.DisplayRole))
+            try:
+                width = fm.horizontalAdvance(
+                    self.headerData(section, orientation, Qt.DisplayRole))
+            except AttributeError:
+                width = fm.width(
+                    self.headerData(section, orientation, Qt.DisplayRole))
             return QSize(width, height)
         
         if orientation == Qt.Horizontal and role == Qt.DisplayRole:

eric ide

mercurial