eric6/WebBrowser/CookieJar/CookieExceptionsModel.py

changeset 7366
bd743eacfbca
parent 7360
9190402e4505
child 7781
607a6098cb44
equal deleted inserted replaced
7365:da7e4df94076 7366:bd743eacfbca
45 @return requested data 45 @return requested data
46 """ 46 """
47 if role == Qt.SizeHintRole: 47 if role == Qt.SizeHintRole:
48 fm = QFontMetrics(QFont()) 48 fm = QFontMetrics(QFont())
49 height = fm.height() + fm.height() // 3 49 height = fm.height() + fm.height() // 3
50 width = fm.width( 50 try:
51 self.headerData(section, orientation, Qt.DisplayRole)) 51 width = fm.horizontalAdvance(
52 self.headerData(section, orientation, Qt.DisplayRole))
53 except AttributeError:
54 width = fm.width(
55 self.headerData(section, orientation, Qt.DisplayRole))
52 return QSize(width, height) 56 return QSize(width, height)
53 57
54 if orientation == Qt.Horizontal and role == Qt.DisplayRole: 58 if orientation == Qt.Horizontal and role == Qt.DisplayRole:
55 try: 59 try:
56 return self.__headers[section] 60 return self.__headers[section]

eric ide

mercurial