• PySide 模块
  • PySide.QtWebKit
  • 内容表

    上一话题

    QWebInspector

    下一话题

    QWebView

    QGraphicsWebView

    注意

    该类在 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.

    Browser Features

    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.

    class PySide.QtWebKit. QGraphicsWebView ( [ parent=None ] )
    参数: parent PySide.QtGui.QGraphicsItem

    构造空 PySide.QtWebKit.QGraphicsWebView 采用父级 parent .

    PySide.QtWebKit.QGraphicsWebView. back ( )

    方便槽,用于把先前文档加载进由导航链接构建的文档列表。什么都不做,若没有先前文档。

    PySide.QtWebKit.QGraphicsWebView. findText ( subString [ , options=0 ] )
    参数:
    • subString – unicode
    • options PySide.QtWebKit.QWebPage.FindFlags
    返回类型:

    PySide.QtCore.bool

    PySide.QtWebKit.QGraphicsWebView. forward ( )

    方便槽,用于把下一文档加载进由导航链接构建的文档列表。什么都不做,若没有下一文档。

    PySide.QtWebKit.QGraphicsWebView. history ( )
    返回类型: PySide.QtWebKit.QWebHistory

    返回指向导航网页的视图历史的指针。

    它相当于

    view.page().history()
    												
    PySide.QtWebKit.QGraphicsWebView. icon ( )
    返回类型: PySide.QtGui.QIcon

    This property holds the icon associated with the web page currently viewed.

    默认情况下,此特性包含 null 图标。

    PySide.QtWebKit.QGraphicsWebView. iconChanged ( )
    PySide.QtWebKit.QGraphicsWebView. isModified ( )
    返回类型: 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.QtWebKit.QGraphicsWebView. isTiledBackingStoreFrozen ( )
    返回类型: 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

    PySide.QtWebKit.QGraphicsWebView. linkClicked ( arg__1 )
    参数: arg__1 PySide.QtCore.QUrl
    PySide.QtWebKit.QGraphicsWebView. load ( request [ , operation=QNetworkAccessManager.GetOperation [ , body=QByteArray() ] ] )
    参数:
    PySide.QtWebKit.QGraphicsWebView. load ( url )
    参数: url PySide.QtCore.QUrl

    加载指定 url 并显示它。

    注意

    The view remains the same until enough data has arrived to display the new url .

    PySide.QtWebKit.QGraphicsWebView. loadFinished ( arg__1 )
    参数: arg__1 PySide.QtCore.bool
    PySide.QtWebKit.QGraphicsWebView. loadProgress ( progress )
    参数: progress PySide.QtCore.int
    PySide.QtWebKit.QGraphicsWebView. loadStarted ( )
    PySide.QtWebKit.QGraphicsWebView. page ( )
    返回类型: PySide.QtWebKit.QWebPage

    返回指向底层 Web 页面的指针。

    PySide.QtWebKit.QGraphicsWebView. pageAction ( action )
    参数: action PySide.QtWebKit.QWebPage.WebAction
    返回类型: PySide.QtGui.QAction
    PySide.QtWebKit.QGraphicsWebView. reload ( )

    重新加载当前文档。

    PySide.QtWebKit.QGraphicsWebView. renderHints ( )
    返回类型: 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.QtWebKit.QGraphicsWebView. resizesToContents ( )
    返回类型: 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.

    PySide.QtWebKit.QGraphicsWebView. setContent ( data [ , mimeType="" [ , baseUrl=QUrl() ] ] )
    参数:

    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 被立即加载;外部对象是异步加载的。

    PySide.QtWebKit.QGraphicsWebView. setHtml ( html [ , baseUrl=QUrl() ] )
    参数:

    将 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.

    PySide.QtWebKit.QGraphicsWebView. setPage ( arg__1 )
    参数: 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.

    PySide.QtWebKit.QGraphicsWebView. setRenderHint ( arg__1 [ , enabled=true ] )
    参数:
    • arg__1 PySide.QtGui.QPainter.RenderHint
    • enabled PySide.QtCore.bool
    PySide.QtWebKit.QGraphicsWebView. setRenderHints ( arg__1 )
    参数: 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()

    PySide.QtWebKit.QGraphicsWebView. setResizesToContents ( enabled )
    参数: 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.

    PySide.QtWebKit.QGraphicsWebView. setTiledBackingStoreFrozen ( frozen )
    参数: 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

    PySide.QtWebKit.QGraphicsWebView. setUrl ( arg__1 )
    参数: arg__1 PySide.QtCore.QUrl

    This property holds the url of the web page currently viewed.

    设置此特性清零视图并加载 URL。

    默认情况下,此特性包含空的无效 URL。

    PySide.QtWebKit.QGraphicsWebView. setZoomFactor ( arg__1 )
    参数: arg__1 PySide.QtCore.qreal

    此特性保持视图的缩放因子。

    PySide.QtWebKit.QGraphicsWebView. settings ( )
    返回类型: PySide.QtWebKit.QWebSettings

    Returns a pointer to the view/page specific settings object.

    它相当于

    view.page().settings()
    												
    PySide.QtWebKit.QGraphicsWebView. statusBarMessage ( message )
    参数: message – unicode
    PySide.QtWebKit.QGraphicsWebView. stop ( )

    停止加载文档的方便槽。

    PySide.QtWebKit.QGraphicsWebView. title ( )
    返回类型: unicode

    This property holds the title of the web page currently viewed.

    默认情况下,此特性包含空字符串。

    PySide.QtWebKit.QGraphicsWebView. titleChanged ( arg__1 )
    参数: arg__1 – unicode
    PySide.QtWebKit.QGraphicsWebView. triggerPageAction ( action [ , checked=false ] )
    参数:
    PySide.QtWebKit.QGraphicsWebView. url ( )
    返回类型: PySide.QtCore.QUrl

    This property holds the url of the web page currently viewed.

    设置此特性清零视图并加载 URL。

    默认情况下,此特性包含空的无效 URL。

    PySide.QtWebKit.QGraphicsWebView. urlChanged ( arg__1 )
    参数: arg__1 PySide.QtCore.QUrl
    PySide.QtWebKit.QGraphicsWebView. zoomFactor ( )
    返回类型: PySide.QtCore.qreal

    此特性保持视图的缩放因子。