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: |