commit c34b12b34cb1af16b445d1b7d3b19d406c5620d9
Author: Andre Pedralho <andre.pedralho@gmail.com>
Date:   Wed Nov 17 12:15:10 2010 -0400

    Added example that uses WebKit to create a Hybrid Application.
    
    The HybridApp is an example of how to develop Hybrid Applications: the core of the application
    is developed using HTML, JavaScript and CSS and is embedded in a WebKit/Qt framework.

diff --git a/examples/webkit/hybridapp/html/index.html b/examples/webkit/hybridapp/html/index.html
new file mode 100644
index 0000000..b937e2c
--- /dev/null
+++ b/examples/webkit/hybridapp/html/index.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+    <link rel="stylesheet" href="style.css" type="text/css">
+
+    <script language="javascript" type="text/javascript" src="rss.js"></script>
+</head>
+<body onLoad="rss.init()">
+    <div class="container">
+        <h1>Qt Labs Blog</h1>
+        <div id="rss_container">
+            <!-- dynamic content -->
+        </div>
+        <a id="refresh_button" class="button" href="javascript:void(0);">Refresh</a>
+    </div>
+</body>
+</html>
diff --git a/examples/webkit/hybridapp/html/rss.js b/examples/webkit/hybridapp/html/rss.js
new file mode 100644
index 0000000..293e43a
--- /dev/null
+++ b/examples/webkit/hybridapp/html/rss.js
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// The feed we are reading from.
+var QT_LABS_FEED = 'http://labs.qt.nokia.com/feed/';
+
+// A template for each RSS entry we find.
+var ENTRY_TEMPLATE = '<a class="rss_item" href="{LINK}">' +
+                        '<div>{INDEX}. {TITLE}</div>' +
+                        '<span>{CATEGORY}</span>' +
+                    '</a>';
+
+// A helper constant.
+var VOID_LINK = 'javascript:void(0);';
+
+var rss = {
+    isConnected: false,
+
+    /**
+     * @method init
+     * @description This method is called when the HTML body is loaded.
+     * It tells the Qt application it is ready to be started or starts itself
+     * if there is no Qt application.
+     */
+    init: function() {
+
+        document.getElementById("refresh_button").onclick = rss.refresh;
+
+        if (typeof HybridApp !== 'undefined')
+            rss.isConnected = HybridApp.isConnected();
+
+        if (rss.isConnected) {
+            HybridApp.setStatusMessage('Starting');
+            HybridApp.run('rss.refresh();');
+        } else
+            rss.refresh();
+    },
+
+    /**
+     * @method refresh
+     * @description This method just calls our AJAX wrapper method with local parameters
+     * in order to update the XML feed.
+     */
+    refresh: function() {
+        if (rss.isConnected)
+            HybridApp.setStatusMessage('Loading');
+
+        rss.updateContent("Loading...");
+        rss.call(QT_LABS_FEED, rss.show, rss.exceptionHandler);
+    },
+
+    /**
+     * @method show
+     * @description This method is called when the AJAX request succeeds getting the information
+     * and mount the application view using the previous defined template.
+     * @param {object} The XML returned by the AJAX request.
+     */
+    show: function(data) {
+        // The XML we are waiting for contains a list of 'item' tags.
+        // Each item contains (among others) a title, one or more categories and a link.
+        var items = data.getElementsByTagName('item');
+        if (items.length === 0) {
+            rss.updateContent("No entries found.");
+            return;
+        }
+
+        // Parsing the XML: for each 'item' found we get the first (and unique) 'title'
+        // and 'link' elements and a list of categories.
+        // Then we will create an entry using the template with the information above.
+        var content = '';
+        for(var i = 0; i < items.length; ++i) {
+            var item = items[i];
+            var title = item.getElementsByTagName('title');
+            var categories = item.getElementsByTagName('category');
+
+            if (title.length > 0) {
+                // If we don't find a link the entry should not be clickable.
+                var link = item.getElementsByTagName('link');
+                link = link.length > 0 ? link[0].firstChild.nodeValue : VOID_LINK;
+
+                // The list of categories of an item separated by pipes '|'.
+                var categoryText = '';
+                for (var j = 0; j < categories.length; ++j)
+                    categoryText += ' | ' + categories[j].firstChild.nodeValue;
+                // A small hack to not show the pipe before the first category.
+                categoryText = categoryText.replace(' | ', '');
+
+                // Finally we mount the entry replacing the information in the template
+                // by the ones we got.
+                content += ENTRY_TEMPLATE.replace('{LINK}', link).replace('{INDEX}', i + 1)
+                    .replace('{TITLE}', title[0].firstChild.nodeValue)
+                    .replace('{CATEGORY}', categoryText);
+            }
+        }
+        rss.updateContent(content);
+
+        if (rss.isConnected)
+            HybridApp.setStatusMessage('Done');
+    },
+
+    /**
+     * @method updateContent
+     * @description This method updates the main container with fresh information,
+     * @param {string} the string to be shown in the container (may be a piece if HTML)
+     */
+    updateContent: function(content) {
+        var container = document.getElementById('rss_container');
+        if (container !== null)
+            container.innerHTML = content;
+    },
+
+    /**
+     * @method exceptionHandler
+     * @description This method is called when the AJAX request fails,
+     */
+    exceptionHandler: function() {
+        if (rss.isConnected)
+            HybridApp.setStatusMessage('Error');
+
+        rss.updateContent('Verify your Internet connection and try again.');
+    },
+
+    /**
+     * @method call
+     * @description This method is a AJAX request wrapper.
+     * @param {string} The URL we are requesting.
+     * @param {function} The success callback.
+     * @param {function} The error callback.
+     */
+    call: function(url, success, error) {
+        var request = new XMLHttpRequest();
+
+        try {
+            netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
+            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
+        } catch(e) {}
+
+        request.open('GET', url, true);
+        request.onreadystatechange = function() {
+            if (request.readyState === 4) {
+                if (request.status === 0 || request.status === 200) {
+                    if (request.responseText === '') {
+                        if (error)
+                            error();
+                    } else if (success)
+                        success(request.responseXML);
+                } else {
+                    if (error)
+                        error();
+                }
+            }
+        };
+        request.send('');
+    }
+};
+
diff --git a/examples/webkit/hybridapp/html/style.css b/examples/webkit/hybridapp/html/style.css
new file mode 100644
index 0000000..0c5e8b2
--- /dev/null
+++ b/examples/webkit/hybridapp/html/style.css
@@ -0,0 +1,65 @@
+* {
+    margin: 0;
+    padding: 0;
+}
+
+a:link, a:visited {
+    color: #C3C3C3;
+    outline: none;
+    text-decoration: none;
+}
+
+body {
+    background-color: #282828;
+    color: #C3C3C3;
+    font-size: 14px;
+    height: 640px;
+    text-align: center;
+    width: 360px;
+}
+
+h1 {
+    margin: 15px;
+}
+
+#rss_container {
+    min-height: 510px;
+}
+
+.button, .button:visited {
+    background-color: #212121;
+    border-bottom: 1px solid rgba(0,0,0,0.25);
+    border-radius: 6px;
+    bottom: auto 0;
+    box-shadow: 0 1px 3px rgba(0,0,0,0.6);
+    display: inline-block;
+    padding: 5px 10px 6px;
+    position: relative;
+    text-align: center;
+    text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
+}
+
+.rss_item {
+    background-color: #1C1C1C;
+    border-radius: 10px;
+    color: #C3C3C3;
+    display: block;
+    margin: 5px;
+    padding: 5px 10px;
+    opacity: 0.8;
+    text-align: left;
+}
+
+.rss_item:hover, .rss_item:active {
+    background-color: #212121;
+}
+
+.rss_item div {
+    font-size: 16px;
+}
+
+.rss_item span {
+    color: #757575;
+}
+
+
diff --git a/examples/webkit/hybridapp/hybridapp.cpp b/examples/webkit/hybridapp/hybridapp.cpp
new file mode 100644
index 0000000..532b685
--- /dev/null
+++ b/examples/webkit/hybridapp/hybridapp.cpp
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "hybridapp.h"
+
+/**
+  * @method HybridApp contructor
+  * @description The HybridApp is shared with the Web application by the Web view.
+  * The Web application is able to call its Q_INVOKABLE/signals/slots methods and
+  * access its properties.
+  * @param {QObject} an optional parent.
+  */
+HybridApp::HybridApp(QObject *parent) :
+    QObject(parent)
+{
+
+}
+
+/**
+  * @method run
+  * @description This method is called by the Web application when it wants that the
+  * Web view runs a piece of JS code.
+  * @param {QString} The piece of JavaScript code to be run.
+  */
+void HybridApp::run(const QString javaScriptCallback)
+{
+    emit javaScriptChanged(javaScriptCallback);
+}
+
+/**
+  * @method setStatusMessage
+  * @description This method receives a new message from the Web application. In our case we just
+  * use it to update the status bar in the Main Window.
+  * @param {QString} The message.
+  */
+void HybridApp::setStatusMessage(const QString message)
+{
+    emit statusMessageChanged(message);
+}
+
diff --git a/examples/webkit/hybridapp/hybridapp.h b/examples/webkit/hybridapp/hybridapp.h
new file mode 100644
index 0000000..6658697
--- /dev/null
+++ b/examples/webkit/hybridapp/hybridapp.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef HYBRIDAPP_H
+#define HYBRIDAPP_H
+
+#include <QObject>
+
+class HybridApp : public QObject
+{
+    Q_OBJECT
+public:
+    explicit HybridApp(QObject *parent = 0);
+    Q_INVOKABLE bool isConnected() { return true; }
+    Q_INVOKABLE void run(const QString javaScriptCallback);
+    Q_INVOKABLE void setStatusMessage(const QString message);
+
+signals:
+    void javaScriptChanged(const QString);
+    void statusMessageChanged(const QString);
+};
+
+#endif // HYBRIDAPP_H
+
diff --git a/examples/webkit/hybridapp/hybridapp.pro b/examples/webkit/hybridapp/hybridapp.pro
new file mode 100644
index 0000000..36da544
--- /dev/null
+++ b/examples/webkit/hybridapp/hybridapp.pro
@@ -0,0 +1,19 @@
+QT       += core gui webkit
+
+SOURCES += hybridapp.cpp \
+    main.cpp \
+    mainwindow.cpp \
+    webview.cpp
+
+HEADERS  += hybridapp.h \
+    mainwindow.h \
+    webview.h
+
+RESOURCES += \
+    hybridapp.qrc
+
+# install
+target.path = $$[QT_INSTALL_EXAMPLES]/webkit/hybridapp
+sources.files = $$SOURCES $$HEADERS
+sources.path = $$[QT_INSTALL_EXAMPLES]/webkit/hybridapp
+INSTALLS += target sources
diff --git a/examples/webkit/hybridapp/hybridapp.qrc b/examples/webkit/hybridapp/hybridapp.qrc
new file mode 100644
index 0000000..67b62b9
--- /dev/null
+++ b/examples/webkit/hybridapp/hybridapp.qrc
@@ -0,0 +1,7 @@
+<RCC>
+    <qresource prefix="/">
+        <file>html/index.html</file>
+        <file>html/rss.js</file>
+        <file>html/style.css</file>
+    </qresource>
+</RCC>
diff --git a/examples/webkit/hybridapp/main.cpp b/examples/webkit/hybridapp/main.cpp
new file mode 100644
index 0000000..6351cbd
--- /dev/null
+++ b/examples/webkit/hybridapp/main.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <iostream>
+#include <QtGui/QApplication>
+
+#include "mainwindow.h"
+
+int main(int argc, char * argv[])
+{
+    QApplication a(argc, argv);
+
+    MainWindow w;
+    w.show();
+
+    return a.exec();
+}
+
diff --git a/examples/webkit/hybridapp/mainwindow.cpp b/examples/webkit/hybridapp/mainwindow.cpp
new file mode 100644
index 0000000..8ec7dee
--- /dev/null
+++ b/examples/webkit/hybridapp/mainwindow.cpp
@@ -0,0 +1,90 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "mainwindow.h"
+
+#include "webview.h"
+
+#include <QtGui/QGraphicsView>
+#include <QtGui/QGraphicsScene>
+#include <QtGui/QStatusBar>
+#include <QtWebKit/QGraphicsWebView>
+
+/**
+  * Main idea here is to create a window with a Graphics Scene showing a Web Graphics View.
+  * The Web View will be the responsible for showing and interacting with the Web application.
+  * By Web application we mean a HTML, JavaScript and CSS application.
+  * In this example the Web application requests for a feed, mount and show a list of blog entries.
+  * The Web view interacts with the Web application using the HybridApp object which is shared among them.
+  * The Web application is allowed to ask to the Web View to run a JavaScript method and to send it
+  * a status message. Of course, it can be extended for example in a browser navigation system.
+  */
+MainWindow::MainWindow(QWidget *parent)
+    : QMainWindow(parent)
+    , m_scene(new QGraphicsScene)
+    , m_webView(new WebView)
+{
+    // Adding the Web view to the scene and setting the scene area.
+    // With the area we chose it fits in a mobile screen.
+    m_scene->addItem(m_webView);
+    m_scene->setSceneRect(QRectF(0, 0, 360, 640));
+
+    // We do not want to have scrollbars or context menus on that example.
+    m_view = new QGraphicsView(m_scene, this);
+    m_view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    m_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+    m_view->setContextMenuPolicy(Qt::NoContextMenu);
+    setCentralWidget(m_view);
+
+    // Loading the Web application stores in our internal resources.
+    m_webView->setHtmlPath(QUrl("qrc:/html/index.html"));
+    m_webView->init();
+
+    // Let's update the status bar with the messages the Web view provides.
+    connect(m_webView, SIGNAL(statusMessageChanged(const QString)),
+            statusBar(), SLOT(showMessage(const QString)));
+}
+
+MainWindow::~MainWindow()
+{
+    delete m_view;
+    delete m_webView;
+}
+
diff --git a/examples/webkit/hybridapp/mainwindow.h b/examples/webkit/hybridapp/mainwindow.h
new file mode 100644
index 0000000..84a39ee
--- /dev/null
+++ b/examples/webkit/hybridapp/mainwindow.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+#include <QtGui/QMainWindow>
+
+class WebView;
+
+class QGraphicsScene;
+class QGraphicsView;
+class QGraphicsWebView;
+class MainWindow : public QMainWindow
+{
+    Q_OBJECT
+
+public:
+    MainWindow(QWidget *parent = 0);
+    ~MainWindow();
+
+private:
+    QGraphicsScene *m_scene;
+    QGraphicsView *m_view;
+    WebView *m_webView;
+};
+
+#endif // MAINWINDOW_H
+
diff --git a/examples/webkit/hybridapp/webview.cpp b/examples/webkit/hybridapp/webview.cpp
new file mode 100644
index 0000000..48a2788
--- /dev/null
+++ b/examples/webkit/hybridapp/webview.cpp
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "webview.h"
+
+#include "hybridapp.h"
+
+#include <QtWebKit/QGraphicsWebView>
+#include <QtWebKit/QWebFrame>
+
+/**
+  * @method WebView constructor.
+  * @description The Web view is the one responsible for rendering the Web application.
+  * It creates and shares a HybridApp object with the Web application.
+  * The HybridApp object contains methods which are called or calls by/the Web applicaiton.
+  * @param {QGraphicsItem} the parent of this Graphic Item.
+  */
+WebView::WebView(QGraphicsItem *parent)
+    : QGraphicsWebView(parent)
+    , m_hybridApp(new HybridApp)
+{
+    // We must enable JavaScript as we are rendering a Web application based on JS.
+    // We also allow it to access remote URLs as our example is a feed reader.
+    QWebSettings* webSettings = QWebSettings::globalSettings();
+    webSettings->setAttribute(QWebSettings::JavascriptEnabled, true);
+    webSettings->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
+
+    // Let's make it fits to the device screen.
+    setResizesToContents(true);
+    page()->setPreferredContentsSize(QSize(360, 640));
+    resizeWebViewToFrame();
+
+    // We need to resize it to fit the device screen after all the page loads.
+    connect(this, SIGNAL(loadFinished(bool)), SLOT(resizeWebViewToFrame()));
+
+    // This signal is emitted when the Web application asks us to run a piece of JS.
+    connect(m_hybridApp, SIGNAL(javaScriptChanged(const QString)),
+            SLOT(evaluateJavaScript(const QString)));
+
+    // We just by pass the signal that updates the status message.
+    // The Main window will handle it updating the status bar with the message.
+    connect(m_hybridApp, SIGNAL(statusMessageChanged(const QString)),
+            SIGNAL(statusMessageChanged(const QString)));
+}
+
+WebView::~WebView()
+{
+    delete m_hybridApp;
+}
+
+/**
+  * @method init
+  * @description This method loads the Web application and connects the necessary signals.
+  */
+void WebView::init()
+{
+    load(m_pathToHtml);
+
+    QWebFrame *mainFrame = page()->mainFrame();
+    if (mainFrame)
+        connect(mainFrame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(addObjectToJavaScript()));
+}
+
+/**
+  * @method evaluateJavaScript
+  * @description This method runs a given JavaScript piece of code in the current page.
+  * @param {QString} the piece of JavaScript code to be run in the current page.
+  */
+void WebView::evaluateJavaScript(const QString javaScriptCallback)
+{
+    page()->mainFrame()->evaluateJavaScript(javaScriptCallback);
+}
+
+/**
+  * @method addObjectToJavaScript
+  * @description This method shares the HybridApp object with the Web application.
+  */
+void WebView::addObjectToJavaScript()
+{
+    page()->mainFrame()->addToJavaScriptWindowObject(QString("HybridApp"), m_hybridApp);
+}
+
+/**
+  * @method resizeWebViewToFrame
+  * @description This method guarantees that the Web view will fit the screen size.
+  */
+void WebView::resizeWebViewToFrame()
+{
+    if (page() && page()->mainFrame()) {
+        QSizeF sizeF = page()->mainFrame()->contentsSize();
+        sizeF = sizeF.expandedTo(size());
+        setGeometry(QRectF(geometry().topLeft(), sizeF));
+    }
+}
+
diff --git a/examples/webkit/hybridapp/webview.h b/examples/webkit/hybridapp/webview.h
new file mode 100644
index 0000000..4ab5a77
--- /dev/null
+++ b/examples/webkit/hybridapp/webview.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
+**     the names of its contributors may be used to endorse or promote
+**     products derived from this software without specific prior written
+**     permission.
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WEBVIEW_H
+#define WEBVIEW_H
+
+#include <QtWebKit/QGraphicsWebView>
+
+class HybridApp;
+class WebView : public QGraphicsWebView
+{
+    Q_OBJECT
+public:
+    WebView(QGraphicsItem *parent = 0);
+    ~WebView();
+
+    inline void setHtmlPath(QUrl pathToHtml) { m_pathToHtml = pathToHtml; }
+    void init();
+
+signals:
+    void statusMessageChanged(const QString message);
+
+private slots:
+    void addObjectToJavaScript();
+    void evaluateJavaScript(const QString);
+    void resizeWebViewToFrame();
+
+private:
+    HybridApp *m_hybridApp;
+    QUrl m_pathToHtml;
+};
+
+#endif // WebView_H
+
diff --git a/examples/webkit/webkit.pro b/examples/webkit/webkit.pro
index 6a1d8f8..b9e6889 100644
--- a/examples/webkit/webkit.pro
+++ b/examples/webkit/webkit.pro
@@ -5,7 +5,8 @@ SUBDIRS +=  domtraversal \
             fancybrowser \
             simpleselector \
             imageanalyzer \
-            framecapture
+            framecapture \
+            hybridapp
 
 contains(QT_CONFIG, openssl):SUBDIRS += googlechat
 
