Note
This class was introduced in Qt 4.6
The 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 module.
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 instead of 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.
Parameters: | parent – PySide.QtGui.QGraphicsItem |
---|
Constructs an empty PySide.QtWebKit.QGraphicsWebView with parent parent .
Convenience slot that loads the previous document in the list of documents built by navigating links. Does nothing if there is no previous document.
Parameters: |
|
---|---|
Return type: | PySide.QtCore.bool |
Convenience slot that loads the next document in the list of documents built by navigating links. Does nothing if there is no next document.
Return type: | PySide.QtWebKit.QWebHistory |
---|
Returns a pointer to the view’s history of navigated web pages.
It is equivalent to
view.page().history()
Return type: | PySide.QtGui.QIcon |
---|
This property holds the icon associated with the web page currently viewed.
By default, this property contains a null icon.
Return type: | 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 attribute on HTML elements.
By default, this property is false.
Return type: | 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.
See also
QWebSettings.TiledBackingStoreEnabled QGraphicsObject.scale
Parameters: | arg__1 – PySide.QtCore.QUrl |
---|
Parameters: |
|
---|
Parameters: | url – PySide.QtCore.QUrl |
---|
Loads the specified url and displays it.
Note
The view remains the same until enough data has arrived to display the new url .
Parameters: | arg__1 – PySide.QtCore.bool |
---|
Parameters: | progress – PySide.QtCore.int |
---|
Return type: | PySide.QtWebKit.QWebPage |
---|
Returns a pointer to the underlying web page.
Parameters: | action – PySide.QtWebKit.QWebPage.WebAction |
---|---|
Return type: | PySide.QtGui.QAction |
Reloads the current document.
Return type: | 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 .
Note
This property is not available on Symbian. However, the getter and setter functions can still be used directly.
See also
QPainter.renderHints()
Return type: | 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.
See also
Parameters: |
|
---|
Sets the content of the web graphicsitem to the specified content data . If the 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 .
The data is loaded immediately; external objects are loaded asynchronously.
Parameters: |
|
---|
Sets the content of the web view to the specified html .
External objects such as stylesheets or images referenced in the HTML document are located relative to baseUrl .
The 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).
Warning
This function works only for HTML, for other mime types (i.e. XHTML, SVG) PySide.QtWebKit.QGraphicsWebView.setContent() should be used instead.
Parameters: | arg__1 – PySide.QtWebKit.QWebPage |
---|
Makes page the new web page of the web graphicsitem.
The parent 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.
Parameters: |
|
---|
Parameters: | 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 .
Note
This property is not available on Symbian. However, the getter and setter functions can still be used directly.
See also
QPainter.renderHints()
Parameters: | 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.
See also
Parameters: | 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.
See also
QWebSettings.TiledBackingStoreEnabled QGraphicsObject.scale
Parameters: | arg__1 – PySide.QtCore.QUrl |
---|
This property holds the url of the web page currently viewed.
Setting this property clears the view and loads the URL.
By default, this property contains an empty, invalid URL.
Parameters: | arg__1 – PySide.QtCore.qreal |
---|
This property holds the zoom factor for the view.
Return type: | PySide.QtWebKit.QWebSettings |
---|
Returns a pointer to the view/page specific settings object.
It is equivalent to
view.page().settings()
See also
Parameters: | message – unicode |
---|
Convenience slot that stops loading the document.
Return type: | unicode |
---|
This property holds the title of the web page currently viewed.
By default, this property contains an empty string.
Parameters: | arg__1 – unicode |
---|
Parameters: |
|
---|
Return type: | PySide.QtCore.QUrl |
---|
This property holds the url of the web page currently viewed.
Setting this property clears the view and loads the URL.
By default, this property contains an empty, invalid URL.
Parameters: | arg__1 – PySide.QtCore.QUrl |
---|
Return type: | PySide.QtCore.qreal |
---|
This property holds the zoom factor for the view.