--- a/src/eric7/WebBrowser/History/HistoryCompleter.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/WebBrowser/History/HistoryCompleter.py Fri Dec 22 17:24:07 2023 +0100 @@ -25,7 +25,8 @@ """ Constructor - @param parent reference to the parent widget (QWidget) + @param parent reference to the parent widget + @type QWidget """ super().__init__(parent) @@ -45,7 +46,8 @@ """ Protected method handling resize events. - @param evt reference to the resize event (QResizeEvent) + @param evt reference to the resize event + @type QResizeEvent """ self.horizontalHeader().resizeSection(0, int(0.65 * self.width())) self.horizontalHeader().setStretchLastSection(True) @@ -56,8 +58,10 @@ """ Public method to give a size hint for rows. - @param row row number (integer) - @return desired row height (integer) + @param row row number + @type int + @return desired row height + @rtype int """ metrics = self.fontMetrics() return metrics.height() @@ -74,7 +78,8 @@ """ Constructor - @param parent reference to the parent object (QObject) + @param parent reference to the parent object + @type QObject """ super().__init__(parent) @@ -89,9 +94,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 the model is valid, tell QCompleter that everything we have # filtered matches what the user typed; if not, nothing matches @@ -113,7 +121,8 @@ """ Public method to get the current search string. - @return current search string (string) + @return current search string + @rtype str """ return self.__searchString @@ -121,7 +130,8 @@ """ Public method to set the current search string. - @param sstring new search string (string) + @param sstring new search string + @type str """ if sstring != self.__searchString: self.__searchString = sstring @@ -137,7 +147,8 @@ """ Public method to check the model for validity. - @return flag indicating a valid status (boolean) + @return flag indicating a valid status + @rtype bool """ return self.__isValid @@ -145,7 +156,8 @@ """ Public method to set the model's validity. - @param valid flag indicating the new valid status (boolean) + @param valid flag indicating the new valid status + @type bool """ if valid == self.__isValid: return @@ -159,9 +171,12 @@ """ Public method to determine, if the row is acceptable. - @param sourceRow row number in the source model (integer) - @param sourceParent index of the source item (QModelIndex) - @return flag indicating acceptance (boolean) + @param sourceRow row number in the source model + @type int + @param sourceParent index of the source item + @type QModelIndex + @return flag indicating acceptance + @rtype bool """ if self.__searchMatcher is not None: # Do a case-insensitive substring match against both the url and @@ -231,8 +246,10 @@ """ Constructor - @param model reference to the model (QAbstractItemModel) - @param parent reference to the parent object (QObject) + @param model reference to the model + @type QAbstractItemModel + @param parent reference to the parent object + @type QObject """ super().__init__(model, parent) @@ -255,8 +272,10 @@ """ Public method to get a path for a given index. - @param idx reference to the index (QModelIndex) - @return the actual URL from the history (string) + @param idx reference to the index + @type QModelIndex + @return the actual URL from the history + @rtype str """ return self.model().data(idx, HistoryModel.UrlStringRole) @@ -265,8 +284,10 @@ Public method to split the given path into strings, that are used to match at each level in the model. - @param path path to be split (string) - @return list of path elements (list of strings) + @param path path to be split + @type str + @return list of path elements + @rtype list of str """ if path == self.__searchString: return ["t"]