注意
该类在 Qt4.6 引入
PySide.QtWebKit.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 PySide.QtWebKit.QWebView are also available for this item, making it simple to adapt existing code to use PySide.QtWebKit.QGraphicsWebView 而不是 PySide.QtWebKit.QWebView .
The item uses a PySide.QtWebKit.QWebPage object to perform the rendering of Web content, and this can be obtained with the PySide.QtWebKit.QGraphicsWebView.page() function, enabling the document itself to be accessed and modified.
As with PySide.QtWebKit.QWebView , the item records the browsing history using a PySide.QtWebKit.QWebHistory object, accessible using the PySide.QtWebKit.QGraphicsWebView.history() function. The PySide.QtWebKit.QWebSettings object that defines the configuration of the browser can be obtained with the PySide.QtWebKit.QGraphicsWebView.settings() function, enabling features like plugin support to be customized for each item.
| 参数: | parent – PySide.QtGui.QGraphicsItem |
|---|
构造空 PySide.QtWebKit.QGraphicsWebView 采用父级 parent .
方便槽,用于把先前文档加载进由导航链接构建的文档列表。什么都不做,若没有先前文档。
| 参数: |
|
|---|---|
| 返回类型: |
PySide.QtCore.bool |
方便槽,用于把下一文档加载进由导航链接构建的文档列表。什么都不做,若没有下一文档。
| 返回类型: | PySide.QtWebKit.QWebHistory |
|---|
返回指向导航网页的视图历史的指针。
它相当于
view.page().history()
| 返回类型: | PySide.QtGui.QIcon |
|---|
This property holds the icon associated with the web page currently viewed.
默认情况下,此特性包含 null 图标。
| 返回类型: | PySide.QtCore.bool |
|---|
This property holds whether the document was modified by the user.
Parts of HTML documents can be editable for example through the contenteditable 属性在 HTML 元素。
默认情况下,此特性为 false。
| 返回类型: | PySide.QtCore.bool |
|---|
This property holds whether the tiled backing store updates its contents.
If the tiled backing store is enabled using QWebSettings.TiledBackingStoreEnabled attribute, this property can be used to disable backing store updates temporarily. This can be useful for example for running a smooth animation that changes the scale of the PySide.QtWebKit.QGraphicsWebView .
When the backing store is unfrozen, its contents will be automatically updated to match the current state of the document. If the PySide.QtWebKit.QGraphicsWebView scale was changed, the backing store is also re-rendered using the new scale.
If the tiled backing store is not enabled, this property does nothing.
另请参阅
QWebSettings.TiledBackingStoreEnabled QGraphicsObject.scale
| 参数: | arg__1 – PySide.QtCore.QUrl |
|---|
| 参数: |
|
|---|
| 参数: | url – PySide.QtCore.QUrl |
|---|
加载指定 url 并显示它。
注意
The view remains the same until enough data has arrived to display the new url .
| 参数: | arg__1 – PySide.QtCore.bool |
|---|
| 参数: | progress – PySide.QtCore.int |
|---|
| 返回类型: | PySide.QtWebKit.QWebPage |
|---|
返回指向底层 Web 页面的指针。
| 参数: | action – PySide.QtWebKit.QWebPage.WebAction |
|---|---|
| 返回类型: | PySide.QtGui.QAction |
重新加载当前文档。
| 返回类型: | PySide.QtGui.QPainter.RenderHints |
|---|
This property holds the default render hints for the view.
These hints are used to initialize PySide.QtGui.QPainter before painting the Web page.
QPainter.TextAntialiasing and QPainter.SmoothPixmapTransform are enabled by default and will be used to render the item in addition of what has been set on the painter given by PySide.QtGui.QGraphicsScene .
注意
This property is not available on Symbian. However, the getter and setter functions can still be used directly.
另请参阅
QPainter.renderHints()
| 返回类型: | PySide.QtCore.bool |
|---|
This property holds whether the size of the PySide.QtWebKit.QGraphicsWebView and its viewport changes to match the contents size.
If this property is set, the PySide.QtWebKit.QGraphicsWebView will automatically change its size to match the size of the main frame contents. As a result the top level frame will never have scrollbars. It will also make CSS fixed positioning to behave like absolute positioning with elements positioned relative to the document instead of the viewport.
This property should be used in conjunction with the QWebPage.preferredContentsSize property. If not explicitly set, the preferredContentsSize is automatically set to a reasonable value.
| 参数: |
|
|---|
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.
内容中引用的外部对象的定位相对于 baseUrl .
data 被立即加载;外部对象是异步加载的。
| 参数: |
|
|---|
将 Web 视图内容设为指定 html .
External objects such as stylesheets or images referenced in the HTML document are located relative to baseUrl .
html 被立即加载;外部对象是异步加载的。
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) PySide.QtWebKit.QGraphicsWebView.setContent() should be used instead.
| 参数: | arg__1 – PySide.QtWebKit.QWebPage |
|---|
Makes page the new web page of the web graphicsitem.
父级 PySide.QtCore.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.
| 参数: |
|
|---|
| 参数: | arg__1 – PySide.QtGui.QPainter.RenderHints |
|---|
This property holds the default render hints for the view.
These hints are used to initialize PySide.QtGui.QPainter before painting the Web page.
QPainter.TextAntialiasing and QPainter.SmoothPixmapTransform are enabled by default and will be used to render the item in addition of what has been set on the painter given by PySide.QtGui.QGraphicsScene .
注意
This property is not available on Symbian. However, the getter and setter functions can still be used directly.
另请参阅
QPainter.renderHints()
| 参数: | enabled – PySide.QtCore.bool |
|---|
This property holds whether the size of the PySide.QtWebKit.QGraphicsWebView and its viewport changes to match the contents size.
If this property is set, the PySide.QtWebKit.QGraphicsWebView will automatically change its size to match the size of the main frame contents. As a result the top level frame will never have scrollbars. It will also make CSS fixed positioning to behave like absolute positioning with elements positioned relative to the document instead of the viewport.
This property should be used in conjunction with the QWebPage.preferredContentsSize property. If not explicitly set, the preferredContentsSize is automatically set to a reasonable value.
| 参数: | frozen – PySide.QtCore.bool |
|---|
This property holds whether the tiled backing store updates its contents.
If the tiled backing store is enabled using QWebSettings.TiledBackingStoreEnabled attribute, this property can be used to disable backing store updates temporarily. This can be useful for example for running a smooth animation that changes the scale of the PySide.QtWebKit.QGraphicsWebView .
When the backing store is unfrozen, its contents will be automatically updated to match the current state of the document. If the PySide.QtWebKit.QGraphicsWebView scale was changed, the backing store is also re-rendered using the new scale.
If the tiled backing store is not enabled, this property does nothing.
另请参阅
QWebSettings.TiledBackingStoreEnabled QGraphicsObject.scale
| 参数: | arg__1 – PySide.QtCore.QUrl |
|---|
This property holds the url of the web page currently viewed.
设置此特性清零视图并加载 URL。
默认情况下,此特性包含空的无效 URL。
| 参数: | arg__1 – PySide.QtCore.qreal |
|---|
此特性保持视图的缩放因子。
| 返回类型: | PySide.QtWebKit.QWebSettings |
|---|
Returns a pointer to the view/page specific settings object.
它相当于
view.page().settings()
| 参数: | message – unicode |
|---|
停止加载文档的方便槽。
| 返回类型: | unicode |
|---|
This property holds the title of the web page currently viewed.
默认情况下,此特性包含空字符串。
| 参数: | arg__1 – unicode |
|---|
| 参数: |
|
|---|
| 返回类型: | PySide.QtCore.QUrl |
|---|
This property holds the url of the web page currently viewed.
设置此特性清零视图并加载 URL。
默认情况下,此特性包含空的无效 URL。
| 参数: | arg__1 – PySide.QtCore.QUrl |
|---|
| 返回类型: | PySide.QtCore.qreal |
|---|
此特性保持视图的缩放因子。