WebView Class Reference
from PyKDE4.plasma import *
Inherits: QGraphicsWidget → QObject
Namespace: Plasma.WebView
Detailed Description
WebView plasma/widgets/webview.h <Plasma/Widgets/WebView>
Provides a widget to display html content in Plasma.
Signals |
| loadFinished (, bool success) |
| loadProgress (, int percent) |
Methods |
| __init__ (self, QGraphicsItem parent=0) |
QSizeF | contentsSize (self) |
| contextMenuEvent (self, QGraphicsSceneContextMenuEvent event) |
| dragEnterEvent (self, QGraphicsSceneDragDropEvent event) |
| dragLeaveEvent (self, QGraphicsSceneDragDropEvent event) |
| dragMoveEvent (self, QGraphicsSceneDragDropEvent event) |
bool | dragToScroll (self) |
| dropEvent (self, QGraphicsSceneDragDropEvent event) |
| focusInEvent (self, QFocusEvent event) |
| focusOutEvent (self, QFocusEvent event) |
QRectF | geometry (self) |
| hoverMoveEvent (self, QGraphicsSceneHoverEvent event) |
QString | html (self) |
| keyPressEvent (self, QKeyEvent event) |
| keyReleaseEvent (self, QKeyEvent event) |
| loadFinished (self, bool success) |
| loadProgress (self, int percent) |
QWebFrame | mainFrame (self) |
| mouseDoubleClickEvent (self, QGraphicsSceneMouseEvent event) |
| mouseMoveEvent (self, QGraphicsSceneMouseEvent event) |
| mousePressEvent (self, QGraphicsSceneMouseEvent event) |
| mouseReleaseEvent (self, QGraphicsSceneMouseEvent event) |
QWebPage | page (self) |
| paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget=0) |
QPointF | scrollPosition (self) |
| setDragToScroll (self, bool drag) |
| setGeometry (self, QRectF geometry) |
| setHtml (self, QString html, KUrl baseUrl=KUrl()) |
| setPage (self, QWebPage page) |
| setScrollPosition (self, QPointF position) |
| setUrl (self, KUrl url) |
| setZoomFactor (self, float zoom) |
QSizeF | sizeHint (self, Qt::SizeHint which, QSizeF constraint) |
KUrl | url (self) |
QRectF | viewportGeometry (self) |
| wheelEvent (self, QGraphicsSceneWheelEvent event) |
float | zoomFactor (self) |
Method Documentation
- Returns:
- the size of the internal widget
- Since:
- 4.4
bool dragToScroll |
( |
|
self ) |
|
- Returns:
- true if the page can be scrolled by dragging the mouse
- Since:
- 4.3
- Returns:
- the html content of the page
loadFinished |
( |
self, |
|
|
|
bool |
success |
|
) |
|
|
|
This signal is emitted when loading is completed.
- Parameters:
-
| success | true if the content was loaded successfully,
otherwise false
|
- Signal syntax:
QObject.connect(source, SIGNAL("loadFinished(bool)"), target_slot)
loadProgress |
( |
self, |
|
|
|
int |
percent |
|
) |
|
|
|
During loading progress, this signal is emitted. The values
are always between 0 and 100, inclusive.
- Parameters:
-
| percent | the estimated amount the loading is complete
|
- Signal syntax:
QObject.connect(source, SIGNAL("loadProgress(int)"), target_slot)
The main web frame associated with this item.
The QWebPage associated with this item. Useful when more
of the features of the full QWebPage object need to be accessed.
- Returns:
- the position of the webpage relative to this widget
- Since:
- 4.4
setDragToScroll |
( |
self, |
|
|
|
bool |
drag |
|
) |
|
|
|
Sets if the page can be scrolled around by dragging the contents with the mouse
- Since:
- 4.3
setGeometry |
( |
self, |
|
|
|
QRectF |
geometry |
|
) |
|
|
|
Sets the html to be shown along with a base URL to be used
to resolve relative references.
- Parameters:
-
| html | the html (in utf8) to display in the content area
|
| baseUrl | the base url for relative references
|
Sets the page to use in this item. The owner of the webpage remains,
however if this WebView object is the owner of the current page,
then the current page is deleted
- Parameters:
-
| page | the page to set in this view
|
setScrollPosition |
( |
self, |
|
|
|
QPointF |
position |
|
) |
|
|
|
Sets the position of the webpage relative to this widget
- Since:
- 4.4
setUrl |
( |
self, |
|
|
|
KUrl |
url |
|
) |
|
|
|
Sets the URL to display. Loading may happen asynchronously.
- Parameters:
-
| url | the location of the content to load.
|
setZoomFactor |
( |
self, |
|
|
|
float |
zoom |
|
) |
|
|
|
Sets the zoom factor of the page
- Since:
- 4.4
- Returns:
- the html content of the page
QRectF viewportGeometry |
( |
|
self ) |
|
The geometry of the area that actually displays the web page
- Since:
- 4.4
float zoomFactor |
( |
|
self ) |
|
The zoom factor of the page
- Since:
- 4.4