Plasma
Plasma::WebView Class Reference
Provides a widget to display html content in Plasma. More...
#include <Plasma/Widgets/WebView>

Signals | |
void | loadFinished (bool success) |
void | loadProgress (int percent) |
Public Member Functions | |
bool | dragToScroll () |
QRectF | geometry () const |
QString | html () const |
QWebFrame * | mainFrame () const |
QWebPage * | page () const |
void | setDragToScroll (bool drag) |
void | setGeometry (const QRectF &geometry) |
void | setHtml (const QString &html, const KUrl &baseUrl=KUrl()) |
void | setHtml (const QByteArray &html, const KUrl &baseUrl=KUrl()) |
void | setPage (QWebPage *page) |
void | setUrl (const KUrl &url) |
KUrl | url () const |
WebView (QGraphicsItem *parent=0) | |
~WebView () | |
Protected Member Functions | |
void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
void | dropEvent (QGraphicsSceneDragDropEvent *event) |
void | focusInEvent (QFocusEvent *event) |
void | focusOutEvent (QFocusEvent *event) |
void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) |
void | keyPressEvent (QKeyEvent *event) |
void | keyReleaseEvent (QKeyEvent *event) |
void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
void | wheelEvent (QGraphicsSceneWheelEvent *event) |
Properties | |
bool | dragToScroll |
QString | html |
KUrl | url |
Detailed Description
Provides a widget to display html content in Plasma.
Definition at line 46 of file webview.h.
Constructor & Destructor Documentation
Plasma::WebView::WebView | ( | QGraphicsItem * | parent = 0 |
) | [explicit] |
Definition at line 68 of file webview.cpp.
Plasma::WebView::~WebView | ( | ) |
Definition at line 85 of file webview.cpp.
Member Function Documentation
void Plasma::WebView::contextMenuEvent | ( | QGraphicsSceneContextMenuEvent * | event | ) | [protected] |
Definition at line 286 of file webview.cpp.
void Plasma::WebView::dragEnterEvent | ( | QGraphicsSceneDragDropEvent * | event | ) | [protected] |
Definition at line 373 of file webview.cpp.
void Plasma::WebView::dragLeaveEvent | ( | QGraphicsSceneDragDropEvent * | event | ) | [protected] |
Definition at line 389 of file webview.cpp.
void Plasma::WebView::dragMoveEvent | ( | QGraphicsSceneDragDropEvent * | event | ) | [protected] |
Definition at line 404 of file webview.cpp.
bool Plasma::WebView::dragToScroll | ( | ) |
- Returns:
- true if the page can be scrolled by dragging the mouse
- Since:
- 4.3
void Plasma::WebView::dropEvent | ( | QGraphicsSceneDragDropEvent * | event | ) | [protected] |
Definition at line 422 of file webview.cpp.
void Plasma::WebView::focusInEvent | ( | QFocusEvent * | event | ) | [protected] |
Definition at line 355 of file webview.cpp.
void Plasma::WebView::focusOutEvent | ( | QFocusEvent * | event | ) | [protected] |
Definition at line 364 of file webview.cpp.
QRectF Plasma::WebView::geometry | ( | ) | const |
Reimplementation.
Definition at line 124 of file webview.cpp.
void Plasma::WebView::hoverMoveEvent | ( | QGraphicsSceneHoverEvent * | event | ) | [protected] |
Definition at line 216 of file webview.cpp.
QString Plasma::WebView::html | ( | ) | const |
- Returns:
- the html content of the page
void Plasma::WebView::keyPressEvent | ( | QKeyEvent * | event | ) | [protected] |
Definition at line 327 of file webview.cpp.
void Plasma::WebView::keyReleaseEvent | ( | QKeyEvent * | event | ) | [protected] |
Definition at line 341 of file webview.cpp.
void Plasma::WebView::loadFinished | ( | bool | success | ) | [signal] |
This signal is emitted when loading is completed.
- Parameters:
-
success true if the content was loaded successfully, otherwise false
void Plasma::WebView::loadProgress | ( | int | percent | ) | [signal] |
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
QWebFrame * Plasma::WebView::mainFrame | ( | ) | const |
The main web frame associated with this item.
Definition at line 166 of file webview.cpp.
void Plasma::WebView::mouseDoubleClickEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 255 of file webview.cpp.
void Plasma::WebView::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 191 of file webview.cpp.
void Plasma::WebView::mousePressEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 230 of file webview.cpp.
void Plasma::WebView::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | event | ) | [protected] |
Definition at line 270 of file webview.cpp.
QWebPage * Plasma::WebView::page | ( | ) | const |
The QWebPage associated with this item.
Useful when more of the features of the full QWebPage object need to be accessed.
Definition at line 161 of file webview.cpp.
void Plasma::WebView::paint | ( | QPainter * | painter, | |
const QStyleOptionGraphicsItem * | option, | |||
QWidget * | widget = 0 | |||
) | [protected] |
Reimplementation.
Definition at line 181 of file webview.cpp.
void Plasma::WebView::setDragToScroll | ( | bool | drag | ) |
Sets if the page can be scrolled around by dragging the contents with the mouse.
- Since:
- 4.3
Definition at line 171 of file webview.cpp.
void Plasma::WebView::setGeometry | ( | const QRectF & | geometry | ) |
Reimplementation.
Definition at line 438 of file webview.cpp.
void Plasma::WebView::setHtml | ( | const QString & | html, | |
const 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
Definition at line 111 of file webview.cpp.
void Plasma::WebView::setHtml | ( | const QByteArray & | html, | |
const 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
Definition at line 103 of file webview.cpp.
void Plasma::WebView::setPage | ( | 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
Definition at line 133 of file webview.cpp.
void Plasma::WebView::setUrl | ( | const KUrl & | url | ) |
Sets the URL to display.
Loading may happen asynchronously.
- Parameters:
-
url the location of the content to load.
Definition at line 90 of file webview.cpp.
KUrl Plasma::WebView::url | ( | ) | const |
- Returns:
- the html content of the page
void Plasma::WebView::wheelEvent | ( | QGraphicsSceneWheelEvent * | event | ) | [protected] |
Definition at line 308 of file webview.cpp.
Property Documentation
The documentation for this class was generated from the following files: