eric6/WebBrowser/Passwords/PasswordModel.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
equal deleted inserted replaced
8141:27f636beebad 8143:2c730d5fd177
129 siteInfo = self.__manager.siteInfo(site) 129 siteInfo = self.__manager.siteInfo(site)
130 130
131 if siteInfo is None: 131 if siteInfo is None:
132 return None 132 return None
133 133
134 if role == Qt.DisplayRole: 134 if role == Qt.ItemDataRole.DisplayRole:
135 if index.column() == 0: 135 if index.column() == 0:
136 return site 136 return site
137 elif index.column() in [1, 2]: 137 elif index.column() in [1, 2]:
138 return siteInfo[index.column() - 1] 138 return siteInfo[index.column() - 1]
139 139
140 return None 140 return None
141 141
142 def headerData(self, section, orientation, role=Qt.DisplayRole): 142 def headerData(self, section, orientation,
143 role=Qt.ItemDataRole.DisplayRole):
143 """ 144 """
144 Public method to get the header data. 145 Public method to get the header data.
145 146
146 @param section section number (integer) 147 @param section section number (integer)
147 @param orientation header orientation (Qt.Orientation) 148 @param orientation header orientation (Qt.Orientation)
148 @param role data role (integer) 149 @param role data role (Qt.ItemDataRole)
149 @return header data 150 @return header data
150 """ 151 """
151 if orientation == Qt.Horizontal and role == Qt.DisplayRole: 152 if (
153 orientation == Qt.Orientation.Horizontal and
154 role == Qt.ItemDataRole.DisplayRole
155 ):
152 try: 156 try:
153 return self.__headers[section] 157 return self.__headers[section]
154 except IndexError: 158 except IndexError:
155 pass 159 pass
156 160

eric ide

mercurial