--- a/WebBrowser/History/HistoryModel.py Thu Mar 23 18:58:56 2017 +0100 +++ b/WebBrowser/History/HistoryModel.py Thu Mar 23 19:06:13 2017 +0100 @@ -121,31 +121,37 @@ return None - def columnCount(self, parent=QModelIndex()): + def columnCount(self, parent=None): """ Public method to get the number of columns. @param parent index of parent (QModelIndex) @return number of columns (integer) """ + if parent is None: + parent = QModelIndex() + if parent.isValid(): return 0 else: return len(self.__headers) - def rowCount(self, parent=QModelIndex()): + def rowCount(self, parent=None): """ Public method to determine the number of rows. @param parent index of parent (QModelIndex) @return number of rows (integer) """ + if parent is None: + parent = QModelIndex() + if parent.isValid(): return 0 else: return len(self.__historyManager.history()) - def removeRows(self, row, count, parent=QModelIndex()): + def removeRows(self, row, count, parent=None): """ Public method to remove history entries from the model. @@ -154,6 +160,9 @@ @param parent index of the parent entry (QModelIndex) @return flag indicating successful removal (boolean) """ + if parent is None: + parent = QModelIndex() + if parent.isValid(): return False