Home | History | Annotate | Download | only in docs
      1 /*!
      2     \module QtWebKit
      3     \title WebKit in Qt
      4     \contentspage All Qt Modules
      5     \previouspage QtSvg
      6     \nextpage QtXml
      7     \ingroup modules
      8     \ingroup technology-apis
      9 
     10     \brief The QtWebKit module provides a web browser engine as well as
     11     classes to render and interact with web content.
     12 
     13     QtWebKit provides a Web browser engine that makes it easy to embed content
     14     from the World Wide Web into your Qt application. At the same time Web
     15     content can be enhanced with native controls.
     16 
     17     QtWebKit provides facilities for rendering of HyperText Markup Language
     18     (HTML), Extensible HyperText Markup Language (XHTML) and Scalable Vector
     19     Graphics (SVG) documents, styled using Cascading Style Sheets (CSS) and
     20     scripted with JavaScript.
     21 
     22     A bridge between the JavaScript execution environment and the Qt object
     23     model makes it possible for custom QObjects to be scripted. For detailed
     24     documentation see \l{The QtWebkit Bridge}.
     25     Integration with the Qt networking module enables Web pages to be transparently loaded
     26     from Web servers, the local file system or even the Qt resource system.
     27 
     28     In addition to providing pure rendering features, HTML documents can be
     29     made fully editable to the user through the use of the \c{contenteditable}
     30     attribute on HTML elements.
     31 
     32     QtWebKit is based on the Open Source WebKit engine. More information about
     33     WebKit itself can be found on the \l{WebKit Open Source Project} Web site.
     34 
     35     \section1 Including In Your Project
     36 
     37     To include the definitions of the module's classes, use the
     38     following directive:
     39 
     40     \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 1
     41 
     42     To link against the module, add this line to your \l qmake \c
     43     .pro file:
     44 
     45     \snippet webkitsnippets/qtwebkit_build_snippet.qdoc 0
     46 
     47     \section1 Notes
     48 
     49     \note Building the QtWebKit module with debugging symbols is problematic
     50     on many platforms due to the size of the WebKit engine. We recommend
     51     building the module only in release mode for embedded platforms.
     52     Currently QtWebKit will always be compiled without debugging symbols
     53     when using gcc. Take a look at the last lines of
     54     \c{src/3rdparty/webkit/Source/WebCore/WebCore.pro} if you need to change this.
     55 
     56     \note Web site icons, also known as "FavIcons", are currently not supported
     57     on Windows. We plan to address this in a future release.
     58 
     59     \note WebKit has certain minimum requirements that must be met on
     60     Embedded Linux systems. See the \l{Qt for Embedded Linux Requirements}
     61     document for more information.
     62 
     63     \section1 Architecture
     64 
     65     The easiest way to render content is through the QWebView class. As a
     66     widget it can be embedded into your forms or a graphics view, and it
     67     provides convenience functions for downloading and rendering web sites.
     68 
     69     \snippet webkitsnippets/simple/main.cpp Using QWebView
     70 
     71     QWebView is used to view Web pages. An instance of QWebView has one
     72     QWebPage. QWebPage provides access to the document structure in a page,
     73     describing features such as frames, the navigation history, and the
     74     undo/redo stack for editable content.
     75 
     76     HTML documents can be nested using frames in a frameset. An individual
     77     frame in HTML is represented using the QWebFrame class. This class includes the
     78     bridge to the JavaScript window object and can be painted using QPainter.
     79     Each QWebPage has one QWebFrame object as its main frame, and the main frame
     80     may contain many child frames.
     81 
     82     Individual elements of an HTML document can be accessed via DOM JavaScript
     83     interfaces from within a web page. The equivalent of this API in QtWebKit
     84     is represented by QWebElement. QWebElement objects are obtained using QWebFrame's
     85     \l{QWebFrame::}{findAllElements()} and \l{QWebFrame::}{findFirstElement()}
     86     functions with CSS selector queries.
     87 
     88     Common web browser features, defaults and other settings can be configured
     89     through the QWebSettings class. It is possible to provide defaults for all
     90     QWebPage instances through the default settings. Individual attributes
     91     can be overidden by the page specific settings object.
     92 
     93     \section1 Netscape Plugin Support
     94 
     95     \note Netscape plugin support is only available on desktop platforms.
     96 
     97     Since WebKit supports the Netscape Plugin API, Qt applications can display
     98     Web pages that embed common plugins on platforms for which those plugins
     99     are available. To enable plugin support, the user must have the appropriate
    100     binary files for those plugins installed and the \l{QWebSettings::PluginsEnabled}
    101     attribute must be enabled for the application.
    102 
    103     The following locations are searched for plugins:
    104 
    105     \table
    106     \header \o Linux/Unix (X11)
    107     \row \o
    108     \list
    109     \o \c{.mozilla/plugins} in the user's home directory
    110     \o \c{.netscape/plugins} in the user's home directory
    111     \o System locations, such as
    112     \list
    113     \o \c{/usr/lib/browser/plugins}
    114     \o \c{/usr/local/lib/mozilla/plugins}
    115     \o \c{/usr/lib/firefox/plugins}
    116     \o \c{/usr/lib64/browser-plugins}
    117     \o \c{/usr/lib/browser-plugins}
    118     \o \c{/usr/lib/mozilla/plugins}
    119     \o \c{/usr/local/netscape/plugins}
    120     \o \c{/opt/mozilla/plugins}
    121     \o \c{/opt/mozilla/lib/plugins}
    122     \o \c{/opt/netscape/plugins}
    123     \o \c{/opt/netscape/communicator/plugins}
    124     \o \c{/usr/lib/netscape/plugins}
    125     \o \c{/usr/lib/netscape/plugins-libc5}
    126     \o \c{/usr/lib/netscape/plugins-libc6}
    127     \o \c{/usr/lib64/netscape/plugins}
    128     \o \c{/usr/lib64/mozilla/plugins}
    129     \endlist
    130     \o Locations specified by environment variables:
    131     \list
    132     \o \c{$MOZILLA_HOME/plugins}
    133     \o \c{$MOZ_PLUGIN_PATH}
    134     \o \c{$QTWEBKIT_PLUGIN_PATH}
    135     \endlist
    136     \endlist
    137     \endtable
    138 
    139     \table
    140     \header  \o Windows
    141     \row \o
    142     \list
    143     \o The user's \c{Application Data\Mozilla\plugins} directory
    144     \o Standard system locations of plugins for Quicktime, Flash, etc.
    145     \endlist
    146     \endtable
    147 
    148     \table
    149     \header \o Mac OS X
    150     \row \o
    151     \list
    152     \o \c{Library/Internet Plug-Ins} in the user's home directory
    153     \o The system \c{/Library/Internet Plug-Ins} directory
    154     \endlist
    155     \endtable
    156 
    157 
    158     \section1 License Information
    159 
    160     This is a snapshot of the Qt port of WebKit. The exact version information
    161     can be found in the \c{src/3rdparty/webkit/VERSION} file supplied with Qt.
    162 
    163     Qt Commercial Edition licensees that wish to distribute applications that
    164     use the QtWebKit module need to be aware of their obligations under the
    165     GNU Library General Public License (LGPL).
    166 
    167     Developers using the Open Source Edition can choose to redistribute
    168     the module under the appropriate version of the GNU LGPL.
    169 
    170     \legalese
    171     WebKit is licensed under the GNU Library General Public License.
    172     Individual contributor names and copyright dates can be found
    173     inline in the code.
    174 
    175     This library is free software; you can redistribute it and/or
    176     modify it under the terms of the GNU Library General Public
    177     License as published by the Free Software Foundation; either
    178     version 2 of the License, or (at your option) any later version.
    179 
    180     This library is distributed in the hope that it will be useful,
    181     but WITHOUT ANY WARRANTY; without even the implied warranty of
    182     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    183     Library General Public License for more details.
    184 
    185     You should have received a copy of the GNU Library General Public License
    186     along with this library; see the file COPYING.LIB.  If not, write to
    187     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    188     Boston, MA 02110-1301, USA.
    189     \endlegalese
    190 */
    191 
    192