KDE 4.2 PyKDE API Reference

- KDE's Python API

# WebView Class Reference

`from PyKDE4.plasma import *`

Inherits: QGraphicsWidget → QObject
Namespace: Plasma

## 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)
| contextMenuEvent (self, QGraphicsSceneContextMenuEvent event)
| dragEnterEvent (self, QGraphicsSceneDragDropEvent event)
| dragLeaveEvent (self, QGraphicsSceneDragDropEvent event)
| dragMoveEvent (self, QGraphicsSceneDragDropEvent event)
| dropEvent (self, QGraphicsSceneDragDropEvent event)
| focusInEvent (self, QFocusEvent event)
| focusOutEvent (self, QFocusEvent event)
QRectF | geometry (self)
| hoverMoveEvent (self, QGraphicsSceneHoverEvent event)
| 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)
| setGeometry (self, QRectF geometry)
| setHtml (self, QByteArray html, KUrl baseUrl=KUrl())
| setHtml (self, QString html, KUrl baseUrl=KUrl())
| setPage (self, QWebPage page)
| setUrl (self, KUrl url)
| wheelEvent (self, QGraphicsSceneWheelEvent event)

## Method Documentation

__init__ | ( | self, |
|  | QGraphicsItem | parent=0
| ) |  |  |

contextMenuEvent | ( | self, |
|  | QGraphicsSceneContextMenuEvent | event
| ) |  |  |

dragEnterEvent | ( | self, |
|  | QGraphicsSceneDragDropEvent | event
| ) |  |  |

dragLeaveEvent | ( | self, |
|  | QGraphicsSceneDragDropEvent | event
| ) |  |  |

dragMoveEvent | ( | self, |
|  | QGraphicsSceneDragDropEvent | event
| ) |  |  |

dropEvent | ( | self, |
|  | QGraphicsSceneDragDropEvent | event
| ) |  |  |

focusInEvent | ( | self, |
|  | QFocusEvent | event
| ) |  |  |

focusOutEvent | ( | self, |
|  | QFocusEvent | event
| ) |  |  |

QRectF geometry | ( |  | self ) |

Reimplementation

hoverMoveEvent | ( | self, |
|  | QGraphicsSceneHoverEvent | event
| ) |  |  |

keyPressEvent | ( | self, |
|  | QKeyEvent | event
| ) |  |  |

keyReleaseEvent | ( | self, |
|  | QKeyEvent | event
| ) |  |  |

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)`

QWebFrame mainFrame | ( |  | self ) |

The main web frame associated with this item.

mouseDoubleClickEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

mouseMoveEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

mousePressEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

mouseReleaseEvent | ( | self, |
|  | QGraphicsSceneMouseEvent | event
| ) |  |  |

QWebPage page | ( |  | self ) |

The QWebPage associated with this item. Useful when more of the features of the full QWebPage object need to be accessed.

paint | ( | self, |
|  | QPainter | painter,
|  | QStyleOptionGraphicsItem | option,
|  | QWidget | widget=0
| ) |  |  |

Reimplementation

setGeometry | ( | self, |
|  | QRectF | geometry
| ) |  |  |

Reimplementation

setHtml | ( | self, |
|  | QByteArray | html,
|  | KUrl | baseUrl=KUrl()
| ) |  |  |

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

setHtml | ( | self, |
|  | QString | html,
|  | KUrl | baseUrl=KUrl()
| ) |  |  |

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

setPage | ( | self, |
|  | QWebPage | page
| ) |  |  |

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

setUrl | ( | self, |
|  | KUrl | url
| ) |  |  |

Sets the URL to display. Loading may happen asynchronously.

Parameters:

  | url | the location of the content to load.

wheelEvent | ( | self, |
|  | QGraphicsSceneWheelEvent | event
| ) |  |  |