--- a/WebBrowser/History/HistoryMenu.py Thu Mar 23 18:58:56 2017 +0100 +++ b/WebBrowser/History/HistoryMenu.py Thu Mar 23 19:06:13 2017 +0100 @@ -55,22 +55,28 @@ return 0 return min(self.__treeModel.rowCount(first), self.MOVEDROWS) - 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() + return self.__treeModel.columnCount(self.mapToSource(parent)) - 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.column() > 0: return 0 @@ -133,7 +139,7 @@ treeIndex = self.__treeModel.mapFromSource(historyIndex) return treeIndex - def index(self, row, column, parent=QModelIndex()): + def index(self, row, column, parent=None): """ Public method to create an index. @@ -142,6 +148,9 @@ @param parent index of the parent item (QModelIndex) @return requested index (QModelIndex) """ + if parent is None: + parent = QModelIndex() + if row < 0 or \ column < 0 or \ column >= self.columnCount(parent) or \