45 @return requested data |
45 @return requested data |
46 """ |
46 """ |
47 if role == Qt.ItemDataRole.SizeHintRole: |
47 if role == Qt.ItemDataRole.SizeHintRole: |
48 fm = QFontMetrics(QFont()) |
48 fm = QFontMetrics(QFont()) |
49 height = fm.height() + fm.height() // 3 |
49 height = fm.height() + fm.height() // 3 |
50 try: |
50 width = fm.horizontalAdvance( |
51 width = fm.horizontalAdvance( |
51 self.headerData(section, orientation, Qt.ItemDataRole.DisplayRole) |
52 self.headerData(section, orientation, Qt.ItemDataRole.DisplayRole) |
52 ) |
53 ) |
|
54 except AttributeError: |
|
55 width = fm.width( |
|
56 self.headerData(section, orientation, Qt.ItemDataRole.DisplayRole) |
|
57 ) |
|
58 return QSize(width, height) |
53 return QSize(width, height) |
59 |
54 |
60 if ( |
55 if ( |
61 orientation == Qt.Orientation.Horizontal |
56 orientation == Qt.Orientation.Horizontal |
62 and role == Qt.ItemDataRole.DisplayRole |
57 and role == Qt.ItemDataRole.DisplayRole |
192 |
187 |
193 @param host name of the host to add a rule for (string) |
188 @param host name of the host to add a rule for (string) |
194 @param rule type of rule to add (CookieJar.Allow, CookieJar.Block or |
189 @param rule type of rule to add (CookieJar.Allow, CookieJar.Block or |
195 CookieJar.AllowForSession) |
190 CookieJar.AllowForSession) |
196 """ |
191 """ |
|
192 from .CookieJar import CookieJar |
|
193 |
197 if not host: |
194 if not host: |
198 return |
195 return |
199 |
|
200 from .CookieJar import CookieJar |
|
201 |
196 |
202 if rule == CookieJar.Allow: |
197 if rule == CookieJar.Allow: |
203 self.__addHost( |
198 self.__addHost( |
204 host, |
199 host, |
205 self.__allowedCookies, |
200 self.__allowedCookies, |