--- a/eric6/WebBrowser/UserAgent/UserAgentModel.py Mon Mar 01 17:48:43 2021 +0100 +++ b/eric6/WebBrowser/UserAgent/UserAgentModel.py Tue Mar 02 17:17:09 2021 +0100 @@ -107,7 +107,7 @@ if userAgent is None: return None - if role == Qt.DisplayRole: + if role == Qt.ItemDataRole.DisplayRole: if index.column() == 0: return host elif index.column() == 1: @@ -115,16 +115,20 @@ return None - def headerData(self, section, orientation, role=Qt.DisplayRole): + def headerData(self, section, orientation, + role=Qt.ItemDataRole.DisplayRole): """ Public method to get the header data. @param section section number (integer) @param orientation header orientation (Qt.Orientation) - @param role data role (integer) + @param role data role (Qt.ItemDataRole) @return header data """ - if orientation == Qt.Horizontal and role == Qt.DisplayRole: + if ( + orientation == Qt.Orientation.Horizontal and + role == Qt.ItemDataRole.DisplayRole + ): try: return self.__headers[section] except IndexError: