|  | Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |

# QtWebKit

QtWebKit provides a web browser engine that makes it easy to embed content from the World Wide Web into your Qt application. At the same time web content can be enhanced with native controls.

QtWebKit supports rendering HTML, XHTML and SVG documents, which can be styled using CSS. The execution of JavaScript is also supported and a bridge between the JavaScript execution environment and the Qt object model makes it possible to script custom QObjects. Due to the integration with the Qt networking module web pages can be transparently loaded from web servers, the local file system or even the Qt resource system.

In addition to the pure rendering of web pages HTML documents can be made fully editable to the user through the `contenteditable` attribute on HTML elements.

QtWebKit is based on the Open Source WebKit engine. More information about WebKit itself can be found on the Project Website.

### Architecture

The easiest way to render web content is through the QWebView class. As a widget it can be embedded into your forms or a graphics view and it provides convenience functions for downloading and rendering web sites.

     QWebView *view = new QWebView(parent);
     view->load("http://www.trolltech.com/");
     view->show();

QWebView acts as view of a web page, which is represented by the QWebPage class. QWebView holds a single instance of a QWebPage, which provides access to structural information such as the frames, the navigation history or the undo/redo stack for editable content.

HTML documents can be nested using frames in a frameset. An individual frame in HTML is represented using the QWebFrame class. It includes the bridge to the JavaScript window object and can be painted with a given QPainter. Each QWebPage has one QWebFrame object as main frame.

Individual browser features, defaults and other settings can be configured through the QWebSettings class. It is possible to provide defaults for all QWebPage instances through the default settings. Individual attributes can be overidden by the page specific settings object.