7 Module implementing a model for password management. |
7 Module implementing a model for password management. |
8 """ |
8 """ |
9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 from PyQt4.QtCore import Qt, QModelIndex, QAbstractTableModel |
12 from PyQt5.QtCore import Qt, QModelIndex, QAbstractTableModel |
13 |
13 |
14 |
14 |
15 class PasswordModel(QAbstractTableModel): |
15 class PasswordModel(QAbstractTableModel): |
16 """ |
16 """ |
17 Class implementing a model for password management. |
17 Class implementing a model for password management. |
41 Public methods to show passwords. |
41 Public methods to show passwords. |
42 |
42 |
43 @param on flag indicating if passwords shall be shown (boolean) |
43 @param on flag indicating if passwords shall be shown (boolean) |
44 """ |
44 """ |
45 self.__showPasswords = on |
45 self.__showPasswords = on |
46 self.reset() |
46 self.beginResetModel() |
|
47 self.endResetModel() |
47 |
48 |
48 def showPasswords(self): |
49 def showPasswords(self): |
49 """ |
50 """ |
50 Public method to indicate, if passwords shall be shown. |
51 Public method to indicate, if passwords shall be shown. |
51 |
52 |
55 |
56 |
56 def __passwordsChanged(self): |
57 def __passwordsChanged(self): |
57 """ |
58 """ |
58 Private slot handling a change of the registered passwords. |
59 Private slot handling a change of the registered passwords. |
59 """ |
60 """ |
60 self.reset() |
61 self.beginResetModel() |
|
62 self.endResetModel() |
61 |
63 |
62 def removeRows(self, row, count, parent=QModelIndex()): |
64 def removeRows(self, row, count, parent=QModelIndex()): |
63 """ |
65 """ |
64 Public method to remove entries from the model. |
66 Public method to remove entries from the model. |
65 |
67 |