The QGraphicsWebView class allows Web content to be added to a GraphicsView . 更多...
继承 QGraphicsWidget .
The QGraphicsWebView class allows Web content to be added to a GraphicsView .
An instance of this class renders Web content from a URL or supplied as data, using features of the QtWebKit 模块。
If the width and height of the item are not set, they will default to 800 and 600, respectively. If the Web page contents is larger than that, scrollbars will be shown if not disabled explicitly.
Many of the functions, signals and properties provided by QWebView are also available for this item, making it simple to adapt existing code to use QGraphicsWebView instead of QWebView .
The item uses a QWebPage object to perform the rendering of Web content, and this can be obtained with the page () function, enabling the document itself to be accessed and modified.
As with QWebView , the item records the browsing history using a QWebHistory object, accessible using the history () 函数。 QWebSettings object that defines the configuration of the browser can be obtained with the settings () function, enabling features like plugin support to be customized for each item.
parent argument, if not None, causes self to be owned by Qt instead of PyQt.
构造空 QGraphicsWebView 采用父级 parent .
另请参阅 load ().
This method is also a Qt slot with the C++ signature void back() .
Convenience slot that loads the previous document in the list of documents built by navigating links. Does nothing if there is no previous document.
另请参阅 forward ().
重实现自 QGraphicsItem.contextMenuEvent ().
重实现自 QGraphicsItem.dragEnterEvent ().
重实现自 QGraphicsItem.dragLeaveEvent ().
重实现自 QGraphicsItem.dragMoveEvent ().
重实现自 QGraphicsItem.dropEvent ().
重实现自 QObject.event ().
查找指定字符串, subString , in the page, using the given options .
If the HighlightAllOccurrences flag is passed, the function will highlight all occurrences that exist in the page. All subsequent calls will extend the highlight, rather than replace it, with occurrences of the new string.
If the HighlightAllOccurrences flag is not passed, the function will select an occurrence and all subsequent calls will replace the current occurrence with the next one.
要清除选定,只需传递空字符串。
返回 true 若 subString was found; otherwise returns false.
另请参阅 QWebPage.selectedText () 和 QWebPage.selectionChanged ().
重实现自 QGraphicsItem.focusInEvent ().
重实现自 QGraphicsWidget.focusNextPrevChild ().
重实现自 QGraphicsItem.focusOutEvent ().
This method is also a Qt slot with the C++ signature void forward() .
Convenience slot that loads the next document in the list of documents built by navigating links. Does nothing if there is no next document.
另请参阅 back ().
Returns a pointer to the view's history of navigated web 页面。
它相当于
view->page()->history();
重实现自 QGraphicsItem.hoverLeaveEvent ().
重实现自 QGraphicsItem.hoverMoveEvent ().
重实现自 QGraphicsItem.inputMethodEvent ().
重实现自 QGraphicsItem.inputMethodQuery ().
重实现自 QGraphicsItem.itemChange ().
重实现自 QGraphicsItem.keyPressEvent ().
重实现自 QGraphicsItem.keyReleaseEvent ().
加载指定 url 并显示它。
注意: The view remains the same until enough data has arrived to display the new url .
另请参阅 setUrl (), url (),和 urlChanged ().
Loads a network request, request , using the method specified in operation .
body is optional and is only used for POST operations.
注意: The view remains the same until enough data has arrived to display the new url.
另请参阅 url () 和 urlChanged ().
重实现自 QGraphicsItem.mouseDoubleClickEvent ().
重实现自 QGraphicsItem.mouseMoveEvent ().
重实现自 QGraphicsItem.mousePressEvent ().
重实现自 QGraphicsItem.mouseReleaseEvent ().
返回指向底层 Web 页面的指针。
另请参阅 setPage ().
返回指针指向 QAction that encapsulates the specified web action action .
重实现自 QGraphicsItem.paint ().
This method is also a Qt slot with the C++ signature void reload() .
重新加载当前文档。
另请参阅 stop () and loadStarted ().
重实现自 QGraphicsItem.sceneEvent ().
Sets the content of the web graphicsitem to the specified content data 。若 mimeType argument is empty it is currently assumed that the content is HTML but in future versions we may introduce auto-detection.
External objects referenced in the content are located relative to baseUrl .
data is loaded immediately; external objects are loaded asynchronously.
另请参阅 load (), setHtml (),和 QWebFrame.toHtml ().
重实现自 QGraphicsLayoutItem.setGeometry ().
将 Web 视图内容设为指定 html .
External objects such as stylesheets or images referenced in the HTML document are located relative to baseUrl .
html is loaded immediately; external objects are loaded asynchronously.
When using this method, WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified through the charset attribute of the HTML script tag. Alternatively, the encoding can also be specified by the web server.
This is a convenience function equivalent to setContent(html, "text/html", baseUrl).
警告: This function works only for HTML, for other mime types (i.e. XHTML, SVG) setContent () should be used 代替。
另请参阅 load (), setContent (), QWebFrame.toHtml (),和 QWebFrame.setContent ().
Makes page the new web page of the web graphicsitem.
父级 QObject of the provided page remains the owner of the object. If the current document is a child of the web view, it will be deleted.
另请参阅 page ().
若 enabled is true, enables the specified render hint ; otherwise disables it.
该函数在 Qt 4.8 引入。
另请参阅 renderHints and QPainter.renderHints ().
Returns a pointer to the view/page specific settings object.
它相当于
view->page()->settings();
另请参阅 QWebSettings.globalSettings ().
重实现自 QGraphicsLayoutItem.sizeHint ().
This method is also a Qt slot with the C++ signature void stop() .
停止加载文档的方便槽。
另请参阅 reload () 和 loadFinished ().
触发指定 action . If it is a checkable action the specified checked 假定状态。
另请参阅 pageAction ().
重实现自 QGraphicsLayoutItem.updateGeometry ().
重实现自 QGraphicsItem.wheelEvent ().
This is the default overload of this signal.
This signal is emitted whenever the icon of the page is loaded or changes.
In order for icons to be loaded, you will need to set an icon database path using QWebSettings.setIconDatabasePath ().
另请参阅 icon () 和 QWebSettings.setIconDatabasePath ().
This is the default overload of this signal.
This signal is emitted whenever the user clicks on a link and the page's linkDelegationPolicy property is set to delegate the link handling for the specified url .
另请参阅 QWebPage.linkDelegationPolicy ().
This is the default overload of this signal.
This signal is emitted when a load of the page is finished. ok will indicate whether the load was successful or any error occurred.
另请参阅 loadStarted ().
This is the default overload of this signal.
This signal is emitted every time an element in the web page completes loading and the overall loading progress advances.
This signal tracks the progress of all child frames.
当前值被提供由 progress and scales from 0 to 100, which is the default range of QProgressBar .
另请参阅 loadStarted () 和 loadFinished ().
This is the default overload of this signal.
This signal is emitted when a new load of the page is started.
另请参阅 loadProgress () 和 loadFinished ().
This is the default overload of this signal.
This signal is emitted when the statusbar text is changed by the page.
This is the default overload of this signal.
此信号被发射每当 title of the main frame changes.
另请参阅 title ().
This is the default overload of this signal.
此信号被发射当 url of the view 改变。