3
3
\title QtWebKit Module
4
\contentspage Qt's Modules
4
\contentspage All Qt Modules
9
\brief An introduction to the QtWebKit module.
8
\brief The QtWebKit module provides a web browser engine as well as
9
classes to render and interact with web content.
11
To include the definitions of the module's classes, use the
14
\snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
16
To link against the module, add this line to your \l qmake \c
19
\snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
21
\section1 License Information
23
This is a snapshot of the Qt port of WebKit. The exact version information
24
can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
26
Qt Commercial Edition licensees that wish to distribute applications that
27
use the QtWebKit module need to be aware of their obligations under the
28
GNU Lesser General Public License (LGPL).
30
Developers using the Open Source Edition can choose to redistribute
31
the module under the appropriate version of the GNU LGPL; version 2.1
32
for applications and libraries licensed under the GNU GPL version 2,
33
or version 3 for applications and libraries licensed under the GNU
37
WebKit is licensed under the GNU Library General Public License.
38
Individual contributor names and copyright dates can be found
41
This library is free software; you can redistribute it and/or
42
modify it under the terms of the GNU Library General Public
43
License as published by the Free Software Foundation; either
44
version 2 of the License, or (at your option) any later version.
46
This library is distributed in the hope that it will be useful,
47
but WITHOUT ANY WARRANTY; without even the implied warranty of
48
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
49
Library General Public License for more details.
51
You should have received a copy of the GNU Library General Public License
52
along with this library; see the file COPYING.LIB. If not, write to
53
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
54
Boston, MA 02110-1301, USA.
59
\page webintegration.html
60
\title Integrating Web Content with QtWebKit
63
\ingroup frameworks-technologies
12
66
\keyword Web Browser
16
68
QtWebKit provides a Web browser engine that makes it easy to embed content
17
69
from the World Wide Web into your Qt application. At the same time Web
18
70
content can be enhanced with native controls.
40
92
\note Building the QtWebKit module with debugging symbols is problematic
41
93
on many platforms due to the size of the WebKit engine. We recommend
42
building the module in release mode only for embedded platforms.
94
building the module only in release mode for embedded platforms.
95
Currently QtWebKit will always be compiled without debugging symbols
96
when using gcc. Take a look at the last lines of
97
\c{src/3rdparty/webkit/WebCore/WebCore.pro} if you need to change this.
44
99
\note Web site icons, also known as "FavIcons", are currently not supported
45
100
on Windows. We plan to address this in a future release.
55
\section1 Configuring the Build Process
57
Applications that use QtWebKit's classes need to be configured to be built
58
against the QtWebKit module. The following declaration in a \c qmake
59
project file ensures that an application is compiled and linked
62
\snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
64
This line is necessary because only the QtCore and QtGui modules are used
65
in the default build process.
67
To include the definitions of the module's classes, use the following
70
\snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
72
110
\section1 Architecture
74
112
The easiest way to render content is through the QWebView class. As a
78
116
\snippet webkitsnippets/simple/main.cpp Using QWebView
80
QWebView acts as a view onto Web pages, each of which is represented by an
81
instance of the QWebPage class. QWebPage provides access to the document
82
structure in a page, describing features such as frames, the navigation
83
history, and the undo/redo stack for editable content.
118
QWebView is used to view Web pages. An instance of QWebView has one
119
QWebPage. QWebPage provides access to the document structure in a page,
120
describing features such as frames, the navigation history, and the
121
undo/redo stack for editable content.
85
123
HTML documents can be nested using frames in a frameset. An individual
86
frame in HTML is represented using the QWebFrame class. It includes the
124
frame in HTML is represented using the QWebFrame class. This class includes the
87
125
bridge to the JavaScript window object and can be painted using QPainter.
88
Each QWebPage has one QWebFrame object as its main frame.
90
Individual browser features, defaults and other settings can be configured
126
Each QWebPage has one QWebFrame object as its main frame, and the main frame
127
may contain many child frames.
129
Individual elements of an HTML document can be accessed via DOM JavaScript
130
interfaces from within a web page. The equivalent of this API in QtWebKit
131
is represented by QWebElement. QWebElement objects are obtained using QWebFrame's
132
\l{QWebFrame::}{findAllElements()} and \l{QWebFrame::}{findFirstElement()}
133
functions with CSS selector queries.
135
Common web browser features, defaults and other settings can be configured
91
136
through the QWebSettings class. It is possible to provide defaults for all
92
137
QWebPage instances through the default settings. Individual attributes
93
138
can be overidden by the page specific settings object.
95
140
\section1 Netscape Plugin Support
142
\note Netscape plugin support is only available on desktop platforms.
97
144
Since WebKit supports the Netscape Plugin API, Qt applications can display
98
Web pages that embed common plugins, as long as the user has the appropriate
99
binary files for those plugins installed.
145
Web pages that embed common plugins on platforms for which those plugins
146
are available. To enable plugin support, the user must have the appropriate
147
binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled}
148
attribute must be enabled for the application.
101
150
The following locations are searched for plugins:
104
\header \o Linux/Unix \o Windows
153
\header \o Linux/Unix (X11) \o Windows
107
156
\o \c{.mozilla/plugins} in the user's home directory
150
199
\o The system \c{/Library/Internet Plug-Ins} directory
154
\section1 License Information
156
This is a snapshot of the Qt port of WebKit. The exact version information
157
can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
159
Qt Commercial Edition licensees that wish to distribute applications that
160
use the QtWebKit module need to be aware of their obligations under the
161
GNU Lesser General Public License (LGPL).
163
Developers using the Open Source Edition can choose to redistribute
164
the module under the appropriate version of the GNU LGPL; version 2.1
165
for applications and libraries licensed under the GNU GPL version 2,
166
or version 3 for applications and libraries licensed under the GNU
170
WebKit is licensed under the GNU Library General Public License.
171
Individual contributor names and copyright dates can be found
174
This library is free software; you can redistribute it and/or
175
modify it under the terms of the GNU Library General Public
176
License as published by the Free Software Foundation; either
177
version 2 of the License, or (at your option) any later version.
179
This library is distributed in the hope that it will be useful,
180
but WITHOUT ANY WARRANTY; without even the implied warranty of
181
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
182
Library General Public License for more details.
184
You should have received a copy of the GNU Library General Public License
185
along with this library; see the file COPYING.LIB. If not, write to
186
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
187
Boston, MA 02110-1301, USA.