--- a/src/eric7/WebBrowser/WebBrowserView.py Fri Dec 22 13:57:47 2023 +0100 +++ b/src/eric7/WebBrowser/WebBrowserView.py Fri Dec 22 17:24:07 2023 +0100 @@ -138,9 +138,12 @@ """ Constructor - @param mainWindow reference to the main window (WebBrowserWindow) - @param parent parent widget of this window (QWidget) - @param name name of this window (string) + @param mainWindow reference to the main window + @type WebBrowserWindow + @param parent parent widget of this window + @type QWidget + @param name name of this window + @type str """ super().__init__(parent) self.setObjectName(name) @@ -289,8 +292,10 @@ """ Public method used to set the source to be displayed. - @param name filename to be shown (QUrl) - @param newTab flag indicating to open the URL in a new tab (bool) + @param name filename to be shown + @type QUrl + @param newTab flag indicating to open the URL in a new tab + @type bool """ if name is None or not name.isValid(): return @@ -372,7 +377,8 @@ """ Public method to return the URL of the loaded page. - @return URL loaded in the help browser (QUrl) + @return URL loaded in the help browser + @rtype QUrl """ return self.url() @@ -380,7 +386,8 @@ """ Public method to return the title of the loaded page. - @return title (string) + @return title + @rtype str """ return self.title() @@ -464,7 +471,8 @@ """ Public method to determine, if a forward move in history is possible. - @return flag indicating move forward is possible (boolean) + @return flag indicating move forward is possible + @rtype bool """ return self.history().canGoForward() @@ -472,7 +480,8 @@ """ Public method to determine, if a backwards move in history is possible. - @return flag indicating move backwards is possible (boolean) + @return flag indicating move backwards is possible + @rtype bool """ return self.history().canGoBack() @@ -480,8 +489,10 @@ """ Private method determining the zoom level index given a zoom factor. - @param zoom zoom factor (integer) - @return index of zoom factor (integer) + @param zoom zoom factor + @type int + @return index of zoom factor + @rtype int """ try: index = self.__zoomLevels.index(zoom) @@ -495,7 +506,8 @@ """ Public method to set the zoom value. - @param value zoom value (integer) + @param value zoom value + @type int @param saveValue flag indicating to save the zoom value with the zoom manager @type bool @@ -511,7 +523,8 @@ """ Public method to get the current zoom value. - @return zoom value (integer) + @return zoom value + @rtype int """ val = self.zoomFactor() * 100 return int(val) @@ -554,7 +567,8 @@ """ Public method to determine, if there is some text selected. - @return flag indicating text has been selected (boolean) + @return flag indicating text has been selected + @rtype bool """ return self.selectedText() != "" @@ -562,9 +576,12 @@ """ Public slot to find the next occurrence of a text. - @param txt text to search for (string) - @param case flag indicating a case sensitive search (boolean) - @param backwards flag indicating a backwards search (boolean) + @param txt text to search for + @type str + @param case flag indicating a case sensitive search + @type bool + @param backwards flag indicating a backwards search + @type bool @param callback reference to a function with a bool parameter @type function(bool) or None """ @@ -1107,8 +1124,10 @@ """ Private method to check a URL for validity. - @param url URL to be checked (QUrl) - @return flag indicating a valid URL (boolean) + @param url URL to be checked + @type QUrl + @return flag indicating a valid URL + @rtype bool """ return ( url.isValid() @@ -1303,7 +1322,8 @@ """ Private slot to search for some text with a selected search engine. - @param act reference to the action that triggered this slot (QAction) + @param act reference to the action that triggered this slot + @type QAction """ searchText = self.selectedText() @@ -1394,7 +1414,8 @@ """ Protected method called by a drag enter event. - @param evt reference to the drag enter event (QDragEnterEvent) + @param evt reference to the drag enter event + @type QDragEnterEvent """ evt.acceptProposedAction() @@ -1402,7 +1423,8 @@ """ Protected method called by a drag move event. - @param evt reference to the drag move event (QDragMoveEvent) + @param evt reference to the drag move event + @type QDragMoveEvent """ evt.ignore() if evt.source() != self: @@ -1420,7 +1442,8 @@ """ Protected method called by a drop event. - @param evt reference to the drop event (QDropEvent) + @param evt reference to the drop event + @type QDropEvent """ super().dropEvent(evt) if ( @@ -1441,7 +1464,8 @@ """ Protected method called by a mouse press event. - @param evt reference to the mouse event (QMouseEvent) + @param evt reference to the mouse event + @type QMouseEvent """ if WebBrowserWindow.autoScroller().mousePress(self, evt): evt.accept() @@ -1451,7 +1475,8 @@ """ Protected method called by a mouse release event. - @param evt reference to the mouse event (QMouseEvent) + @param evt reference to the mouse event + @type QMouseEvent """ if WebBrowserWindow.autoScroller().mouseRelease(evt): evt.accept() @@ -1469,7 +1494,8 @@ """ Protected method to handle mouse move events. - @param evt reference to the mouse event (QMouseEvent) + @param evt reference to the mouse event + @type QMouseEvent """ if self.__mw and self.__mw.isFullScreen(): if self.__mw.isFullScreenNavigationVisible(): @@ -1485,7 +1511,8 @@ """ Protected method to handle wheel events. - @param evt reference to the wheel event (QWheelEvent) + @param evt reference to the wheel event + @type QWheelEvent """ if WebBrowserWindow.autoScroller().wheel(): evt.accept() @@ -1510,7 +1537,8 @@ """ Protected method called by a key press. - @param evt reference to the key event (QKeyEvent) + @param evt reference to the key event + @type QKeyEvent """ if self.__mw.personalInformationManager().viewKeyPressEvent(self, evt): evt.accept() @@ -1550,7 +1578,8 @@ """ Protected method called by a key release. - @param evt reference to the key event (QKeyEvent) + @param evt reference to the key event + @type QKeyEvent """ if evt.key() == Qt.Key.Key_Escape and self.isFullScreen(): self.triggerPageAction(QWebEnginePage.WebAction.ExitFullScreen) @@ -1661,8 +1690,10 @@ """ Public method handling events. - @param evt reference to the event (QEvent) - @return flag indicating, if the event was handled (boolean) + @param evt reference to the event + @type QEvent + @return flag indicating, if the event was handled + @rtype bool """ if evt.type() == QEvent.Type.Gesture: self._gestureEvent(evt) @@ -1694,7 +1725,8 @@ """ Private slot to handle the urlChanged signal. - @param url the new url (QUrl) + @param url the new url + @type QUrl """ self.sourceChanged.emit(url) @@ -1777,7 +1809,8 @@ """ Private slot to handle the linkHovered signal. - @param link the URL of the link (string) + @param link the URL of the link + @type str """ self.highlighted.emit(link) @@ -1868,7 +1901,8 @@ """ Private method to handle the loadProgress signal. - @param progress progress value (integer) + @param progress progress value + @type int """ self.__progress = progress @@ -1876,7 +1910,8 @@ """ Private method to handle the loadFinished signal. - @param ok flag indicating the result (boolean) + @param ok flag indicating the result + @type bool """ self.__isLoading = False self.__progress = 0 @@ -1917,7 +1952,8 @@ """ Public method to get the loading state. - @return flag indicating the loading state (boolean) + @return flag indicating the loading state + @rtype bool """ return self.__isLoading @@ -1925,7 +1961,8 @@ """ Public method to get the load progress. - @return load progress (integer) + @return load progress + @rtype int """ return self.__progress @@ -2061,8 +2098,9 @@ Public method called, when a new window should be created. @param windowType type of the requested window - (QWebEnginePage.WebWindowType) - @return reference to the created browser window (WebBrowserView) + @type QWebEnginePage.WebWindowType + @return reference to the created browser window + @rtype WebBrowserView """ if windowType in [ QWebEnginePage.WebWindowType.WebBrowserTab, @@ -2091,7 +2129,8 @@ """ Public method to check, if the loaded page contains feed links. - @return flag indicating the existence of feed links (boolean) + @return flag indicating the existence of feed links + @rtype bool """ self.__rss = [] @@ -2109,7 +2148,8 @@ """ Public method to get the extracted RSS feeds. - @return list of RSS feeds (list of tuples of two strings) + @return list of RSS feeds + @rtype list of [(str, str)] """ return self.__rss @@ -2117,7 +2157,8 @@ """ Public method to check, if the loaded page has RSS links. - @return flag indicating the presence of RSS links (boolean) + @return flag indicating the presence of RSS links + @rtype bool """ return len(self.__rss) > 0