Helpviewer/CookieJar/CookieExceptionsModel.py

changeset 12
1d8dd9706f46
parent 7
c679fb30c8f3
child 13
1af94a91f439
equal deleted inserted replaced
11:b0996e4a289e 12:1d8dd9706f46
8 """ 8 """
9 9
10 from PyQt4.QtCore import * 10 from PyQt4.QtCore import *
11 from PyQt4.QtGui import * 11 from PyQt4.QtGui import *
12 12
13 from CookieJar import CookieJar 13 from .CookieJar import CookieJar
14 14
15 class CookieExceptionsModel(QAbstractTableModel): 15 class CookieExceptionsModel(QAbstractTableModel):
16 """ 16 """
17 Class implementing the cookie exceptions model. 17 Class implementing the cookie exceptions model.
18 """ 18 """
44 @param role role of the data to retrieve (integer) 44 @param role role of the data to retrieve (integer)
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 = \ 50 width = \
51 fm.width(self.headerData(section, orientation, Qt.DisplayRole)) 51 fm.width(self.headerData(section, orientation, Qt.DisplayRole))
52 return QSize(width, height) 52 return QSize(width, height)
53 53
54 if orientation == Qt.Horizontal and role == Qt.DisplayRole: 54 if orientation == Qt.Horizontal and role == Qt.DisplayRole:

eric ide

mercurial