WebBrowser/Passwords/PasswordModel.py

changeset 5656
9c21b2746218
parent 5389
9b1c800daff3
child 6048
82ad8ec9548c
equal deleted inserted replaced
5654:d75dfc0d10f2 5656:9c21b2746218
59 Private slot handling a change of the registered passwords. 59 Private slot handling a change of the registered passwords.
60 """ 60 """
61 self.beginResetModel() 61 self.beginResetModel()
62 self.endResetModel() 62 self.endResetModel()
63 63
64 def removeRows(self, row, count, parent=QModelIndex()): 64 def removeRows(self, row, count, parent=None):
65 """ 65 """
66 Public method to remove entries from the model. 66 Public method to remove entries from the model.
67 67
68 @param row start row (integer) 68 @param row start row (integer)
69 @param count number of rows to remove (integer) 69 @param count number of rows to remove (integer)
70 @param parent parent index (QModelIndex) 70 @param parent parent index (QModelIndex)
71 @return flag indicating success (boolean) 71 @return flag indicating success (boolean)
72 """ 72 """
73 if parent is None:
74 parent = QModelIndex()
75
73 if parent.isValid(): 76 if parent.isValid():
74 return False 77 return False
75 78
76 if count <= 0: 79 if count <= 0:
77 return False 80 return False
87 # removeEngine emits changed() 90 # removeEngine emits changed()
88 #self.endRemoveRows() 91 #self.endRemoveRows()
89 92
90 return True 93 return True
91 94
92 def rowCount(self, parent=QModelIndex()): 95 def rowCount(self, parent=None):
93 """ 96 """
94 Public method to get the number of rows of the model. 97 Public method to get the number of rows of the model.
95 98
96 @param parent parent index (QModelIndex) 99 @param parent parent index (QModelIndex)
97 @return number of rows (integer) 100 @return number of rows (integer)
98 """ 101 """
102 if parent is None:
103 parent = QModelIndex()
104
99 if parent.isValid(): 105 if parent.isValid():
100 return 0 106 return 0
101 else: 107 else:
102 return self.__manager.sitesCount() 108 return self.__manager.sitesCount()
103 109
104 def columnCount(self, parent=QModelIndex()): 110 def columnCount(self, parent=None):
105 """ 111 """
106 Public method to get the number of columns of the model. 112 Public method to get the number of columns of the model.
107 113
108 @param parent parent index (QModelIndex) 114 @param parent parent index (QModelIndex) (Unused)
109 @return number of columns (integer) 115 @return number of columns (integer)
110 """ 116 """
111 if self.__showPasswords: 117 if self.__showPasswords:
112 return 3 118 return 3
113 else: 119 else:

eric ide

mercurial