eric6/WebBrowser/ZoomManager/ZoomValuesModel.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
105 siteInfo = self.__manager.siteInfo(site) 105 siteInfo = self.__manager.siteInfo(site)
106 106
107 if siteInfo is None: 107 if siteInfo is None:
108 return None 108 return None
109 109
110 if role == Qt.DisplayRole: 110 if role == Qt.ItemDataRole.DisplayRole:
111 if index.column() == 0: 111 if index.column() == 0:
112 return site 112 return site
113 elif index.column() == 1: 113 elif index.column() == 1:
114 return siteInfo 114 return siteInfo
115 115
116 return None 116 return None
117 117
118 def headerData(self, section, orientation, role=Qt.DisplayRole): 118 def headerData(self, section, orientation,
119 role=Qt.ItemDataRole.DisplayRole):
119 """ 120 """
120 Public method to get the header data. 121 Public method to get the header data.
121 122
122 @param section section number (integer) 123 @param section section number (integer)
123 @param orientation header orientation (Qt.Orientation) 124 @param orientation header orientation (Qt.Orientation)
124 @param role data role (integer) 125 @param role data role (Qt.ItemDataRole)
125 @return header data 126 @return header data
126 """ 127 """
127 if orientation == Qt.Horizontal and role == Qt.DisplayRole: 128 if (
129 orientation == Qt.Orientation.Horizontal and
130 role == Qt.ItemDataRole.DisplayRole
131 ):
128 try: 132 try:
129 return self.__headers[section] 133 return self.__headers[section]
130 except IndexError: 134 except IndexError:
131 pass 135 pass
132 136

eric ide

mercurial