diff -r c712d09cc839 -r f6881d10e995 src/eric7/WebBrowser/History/HistoryTreeModel.py --- a/src/eric7/WebBrowser/History/HistoryTreeModel.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/WebBrowser/History/HistoryTreeModel.py Fri Dec 22 17:24:07 2023 +0100 @@ -25,8 +25,10 @@ """ Constructor - @param sourceModel reference to the source model (QAbstractItemModel) - @param parent reference to the parent object (QObject) + @param sourceModel reference to the source model + @type QAbstractItemModel + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -39,10 +41,14 @@ """ Public method to get the header data. - @param section section number (integer) - @param orientation header orientation (Qt.Orientation) - @param role data role (Qt.ItemDataRole) + @param section section number + @type int + @param orientation header orientation + @type Qt.Orientation + @param role data role + @type Qt.ItemDataRole @return header data + @rtype Any """ return self.sourceModel().headerData(section, orientation, role) @@ -50,9 +56,12 @@ """ Public method to get data from the model. - @param index index of history entry to get data for (QModelIndex) - @param role data role (integer) + @param index index of history entry to get data for + @type QModelIndex + @param role data role + @type int @return history entry data + @rtype Any """ if role in [Qt.ItemDataRole.DisplayRole, Qt.ItemDataRole.EditRole]: start = index.internalId() @@ -91,8 +100,10 @@ """ Public method to get the number of columns. - @param parent index of parent (QModelIndex) - @return number of columns (integer) + @param parent index of parent + @type QModelIndex + @return number of columns + @rtype int """ if parent is None: parent = QModelIndex() @@ -103,8 +114,10 @@ """ Public method to determine the number of rows. - @param parent index of parent (QModelIndex) - @return number of rows (integer) + @param parent index of parent + @type QModelIndex + @return number of rows + @rtype int """ if parent is None: parent = QModelIndex() @@ -143,8 +156,10 @@ Private method to translate the top level date row into the offset where that date starts. - @param row row number of the date (integer) - @return offset where that date starts (integer) + @param row row number of the date + @type int + @return offset where that date starts + @rtype int """ if row <= 0: return 0 @@ -163,8 +178,10 @@ """ Public method to map an index to the source model index. - @param proxyIndex reference to a proxy model index (QModelIndex) - @return source model index (QModelIndex) + @param proxyIndex reference to a proxy model index + @type QModelIndex + @return source model index + @rtype QModelIndex """ offset = proxyIndex.internalId() if offset == 0: @@ -178,10 +195,14 @@ """ Public method to create an index. - @param row row number for the index (integer) - @param column column number for the index (integer) - @param parent index of the parent item (QModelIndex) - @return requested index (QModelIndex) + @param row row number for the index + @type int + @param column column number for the index + @type int + @param parent index of the parent item + @type QModelIndex + @return requested index + @rtype QModelIndex """ if parent is None: parent = QModelIndex() @@ -202,8 +223,10 @@ """ Public method to get the parent index. - @param index index of item to get parent (QModelIndex) - @return index of parent (QModelIndex) + @param index index of item to get parent + @type QModelIndex + @return index of parent + @rtype QModelIndex """ offset = index.internalId() if offset == 0 or not index.isValid(): @@ -214,8 +237,10 @@ """ Public method to check, if an entry has some children. - @param parent index of the entry to check (QModelIndex) - @return flag indicating the presence of children (boolean) + @param parent index of the entry to check + @type QModelIndex + @return flag indicating the presence of children + @rtype bool """ if parent is None: parent = QModelIndex() @@ -229,8 +254,10 @@ """ Public method to get the item flags. - @param index index of the item (QModelIndex) - @return flags (Qt.ItemFlags) + @param index index of the item + @type QModelIndex + @return flags + @rtype Qt.ItemFlags """ return ( Qt.ItemFlag.NoItemFlags @@ -246,7 +273,8 @@ """ Public method to set the source model. - @param sourceModel reference to the source model (QAbstractItemModel) + @param sourceModel reference to the source model + @type QAbstractItemModel """ if self.sourceModel() is not None: self.sourceModel().modelReset.disconnect(self.__sourceReset) @@ -278,9 +306,12 @@ """ Private slot to handle the insertion of data in the source model. - @param parent reference to the parent index (QModelIndex) - @param start start row (integer) - @param end end row (integer) + @param parent reference to the parent index + @type QModelIndex + @param start start row + @type int + @param end end row + @type int """ if not parent.isValid(): if start != 0 or start != end: @@ -303,8 +334,10 @@ """ Public method to map an index to the proxy model index. - @param sourceIndex reference to a source model index (QModelIndex) - @return proxy model index (QModelIndex) + @param sourceIndex reference to a source model index + @type QModelIndex + @return proxy model index + @rtype QModelIndex """ if not sourceIndex.isValid(): return QModelIndex() @@ -329,10 +362,14 @@ """ Public method to remove entries from the model. - @param row row of the first entry to remove (integer) - @param count number of entries to remove (integer) - @param parent index of the parent entry (QModelIndex) - @return flag indicating successful removal (boolean) + @param row row of the first entry to remove + @type int + @param count number of entries to remove + @type int + @param parent index of the parent entry + @type QModelIndex + @return flag indicating successful removal + @rtype bool """ if parent is None: parent = QModelIndex() @@ -362,9 +399,12 @@ """ Private slot to handle the removal of data in the source model. - @param parent reference to the parent index (QModelIndex) - @param start start row (integer) - @param end end row (integer) + @param parent reference to the parent index + @type QModelIndex + @param start start row + @type int + @param end end row + @type int """ if not self.__removingDown: self.beginResetModel()