eric6/WebBrowser/Passwords/PasswordModel.py

changeset 8143
2c730d5fd177
parent 7923
91e843545d9a
child 8218
7c09585bd960
--- a/eric6/WebBrowser/Passwords/PasswordModel.py	Mon Mar 01 17:48:43 2021 +0100
+++ b/eric6/WebBrowser/Passwords/PasswordModel.py	Tue Mar 02 17:17:09 2021 +0100
@@ -131,7 +131,7 @@
         if siteInfo is None:
             return None
         
-        if role == Qt.DisplayRole:
+        if role == Qt.ItemDataRole.DisplayRole:
             if index.column() == 0:
                 return site
             elif index.column() in [1, 2]:
@@ -139,16 +139,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:

eric ide

mercurial