diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2010-03-02 05:55:06 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2010-03-02 05:55:06 (GMT) |
commit | feb79bba984520fa30bad83eb4a6f34cfb86a697 (patch) | |
tree | 9e3ad14e243c84f0dea08bf2dfca19b070fe450d /src | |
parent | 26e6b837ceb90ed3d0df63b39a1cd0ec4dc7aeae (diff) | |
download | Qt-feb79bba984520fa30bad83eb4a6f34cfb86a697.zip Qt-feb79bba984520fa30bad83eb4a6f34cfb86a697.tar.gz Qt-feb79bba984520fa30bad83eb4a6f34cfb86a697.tar.bz2 |
Move WebView to an extension plugin.
Using WebView now requires:
import org.webkit 1.0
Task-number: QT-2995
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/graphicsitems.pri | 7 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp | 3 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/qdeclarativemodules.pro | 1 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/webkitqmlplugin/plugin.cpp | 66 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview.cpp (renamed from src/declarative/graphicsitems/qdeclarativewebview.cpp) | 10 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview_p.h (renamed from src/declarative/graphicsitems/qdeclarativewebview_p.h) | 7 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview_p_p.h (renamed from src/declarative/graphicsitems/qdeclarativewebview_p_p.h) | 0 | ||||
-rw-r--r-- | src/plugins/qdeclarativemodules/webkitqmlplugin/webkitqmlplugin.pro | 18 |
8 files changed, 94 insertions, 18 deletions
diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri index 7a85f00..3ff92b1 100644 --- a/src/declarative/graphicsitems/graphicsitems.pri +++ b/src/declarative/graphicsitems/graphicsitems.pri @@ -84,10 +84,3 @@ SOURCES += \ $$PWD/qdeclarativegraphicsobjectcontainer.cpp \ $$PWD/qdeclarativeparticles.cpp \ $$PWD/qdeclarativelayoutitem.cpp \ - -contains(QT_CONFIG, webkit) { - QT+=webkit - SOURCES += $$PWD/qdeclarativewebview.cpp - HEADERS += $$PWD/qdeclarativewebview_p.h - HEADERS += $$PWD/qdeclarativewebview_p_p.h -} diff --git a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp index f3b9385..e0ae2eb 100644 --- a/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitemsmodule.cpp @@ -139,9 +139,6 @@ void QDeclarativeItemModule::defineModule() QML_REGISTER_TYPE(Qt,4,6,VisibleArea,QDeclarativeFlickableVisibleArea); QML_REGISTER_TYPE(Qt,4,6,VisualDataModel,QDeclarativeVisualDataModel); QML_REGISTER_TYPE(Qt,4,6,VisualItemModel,QDeclarativeVisualItemModel); -#ifdef QT_WEBKIT_LIB - QML_REGISTER_TYPE(Qt,4,6,WebView,QDeclarativeWebView); -#endif QML_REGISTER_NOCREATE_TYPE(QDeclarativeAnchors); QML_REGISTER_NOCREATE_TYPE(QGraphicsEffect); diff --git a/src/plugins/qdeclarativemodules/qdeclarativemodules.pro b/src/plugins/qdeclarativemodules/qdeclarativemodules.pro index 0a6f444..ae53578 100644 --- a/src/plugins/qdeclarativemodules/qdeclarativemodules.pro +++ b/src/plugins/qdeclarativemodules/qdeclarativemodules.pro @@ -3,4 +3,5 @@ TEMPLATE = subdirs SUBDIRS += widgets contains(QT_CONFIG, multimedia): SUBDIRS += multimedia +contains(QT_CONFIG, webkit): SUBDIRS += webkitqmlplugin diff --git a/src/plugins/qdeclarativemodules/webkitqmlplugin/plugin.cpp b/src/plugins/qdeclarativemodules/webkitqmlplugin/plugin.cpp new file mode 100644 index 0000000..2f6205d --- /dev/null +++ b/src/plugins/qdeclarativemodules/webkitqmlplugin/plugin.cpp @@ -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 plugins of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the Technology Preview License Agreement accompanying +** this package. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at qt-info@nokia.com. +** +** +** +** +** +** +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include <QtDeclarative/qdeclarativeextensionplugin.h> +#include <QtDeclarative/qdeclarative.h> + +#include "qdeclarativewebview_p.h" +#include "qdeclarativewebview_p_p.h" + +QT_BEGIN_NAMESPACE + +class WebKitQmlPlugin : public QDeclarativeExtensionPlugin +{ + Q_OBJECT +public: + virtual void registerTypes(const char *uri) + { + Q_ASSERT(QLatin1String(uri) == QLatin1String("org.webkit")); + qmlRegisterType<QDeclarativeWebView>(uri,1,0,"WebView"); + } +}; + +QT_END_NAMESPACE + +#include "plugin.moc" + +Q_EXPORT_PLUGIN2(webkitqmlplugin, QT_PREPEND_NAMESPACE(WebKitQmlPlugin)); + diff --git a/src/declarative/graphicsitems/qdeclarativewebview.cpp b/src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview.cpp index a2b16ba..733ac86 100644 --- a/src/declarative/graphicsitems/qdeclarativewebview.cpp +++ b/src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview.cpp @@ -42,11 +42,11 @@ #include "qdeclarativewebview_p.h" #include "qdeclarativewebview_p_p.h" -#include "qdeclarativepainteditem_p_p.h" +#include <private/qdeclarativepainteditem_p_p.h> #include <qdeclarative.h> #include <qdeclarativeengine.h> -#include <qdeclarativestate_p.h> +#include <private/qdeclarativestate_p.h> #include <QDebug> #include <QPen> @@ -61,7 +61,7 @@ #include <QtWebKit/QWebFrame> #include <QtWebKit/QWebElement> #include <QtWebKit/QWebSettings> -#include <qlistmodelinterface_p.h> +#include <private/qlistmodelinterface_p.h> QT_BEGIN_NAMESPACE @@ -128,6 +128,8 @@ public: usually laying out the web content to fit the preferredWidth. \qml + import org.webkit 1.0 + WebView { url: "http://www.nokia.com" width: 490 @@ -929,7 +931,7 @@ QWebPage *QDeclarativeWebView::page() const } \endqml */ -QDeclarativeWebSettings *QDeclarativeWebView::settingsObject() const +QObject *QDeclarativeWebView::settingsObject() const { Q_D(const QDeclarativeWebView); d->settings.s = page()->settings(); diff --git a/src/declarative/graphicsitems/qdeclarativewebview_p.h b/src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview_p.h index a65aab3..0bb5d29 100644 --- a/src/declarative/graphicsitems/qdeclarativewebview_p.h +++ b/src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview_p.h @@ -42,7 +42,7 @@ #ifndef QDECLARATIVEWEBVIEW_H #define QDECLARATIVEWEBVIEW_H -#include "qdeclarativepainteditem_p.h" +#include <private/qdeclarativepainteditem_p.h> #include <QtGui/QAction> #include <QtCore/QUrl> @@ -82,7 +82,6 @@ private: class QDeclarativeWebViewAttached; -class QDeclarativeWebSettings; //### TODO: browser plugins @@ -112,7 +111,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeWebView : public QDeclarativePaintedItem Q_PROPERTY(QAction* forward READ forwardAction CONSTANT) Q_PROPERTY(QAction* stop READ stopAction CONSTANT) - Q_PROPERTY(QDeclarativeWebSettings* settings READ settingsObject CONSTANT) + Q_PROPERTY(QObject* settings READ settingsObject CONSTANT) Q_PROPERTY(QDeclarativeListProperty<QObject> javaScriptWindowObjects READ javaScriptWindowObjects CONSTANT) @@ -169,7 +168,7 @@ public: QWebHistory *history() const; QWebSettings *settings() const; - QDeclarativeWebSettings *settingsObject() const; + QObject *settingsObject() const; bool renderingEnabled() const; void setRenderingEnabled(bool); diff --git a/src/declarative/graphicsitems/qdeclarativewebview_p_p.h b/src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview_p_p.h index 258b472..258b472 100644 --- a/src/declarative/graphicsitems/qdeclarativewebview_p_p.h +++ b/src/plugins/qdeclarativemodules/webkitqmlplugin/qdeclarativewebview_p_p.h diff --git a/src/plugins/qdeclarativemodules/webkitqmlplugin/webkitqmlplugin.pro b/src/plugins/qdeclarativemodules/webkitqmlplugin/webkitqmlplugin.pro new file mode 100644 index 0000000..37fe37c --- /dev/null +++ b/src/plugins/qdeclarativemodules/webkitqmlplugin/webkitqmlplugin.pro @@ -0,0 +1,18 @@ +TARGET = webkitqmlplugin +include(../../qpluginbase.pri) + +contains(QT_CONFIG, webkit) { + QT += webkit declarative + + SOURCES += qdeclarativewebview.cpp plugin.cpp + HEADERS += qdeclarativewebview_p.h + HEADERS += qdeclarativewebview_p_p.h + + QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/org/webkit + target.path = $$[QT_INSTALL_IMPORTS]/org/webkit + + qmldir.files += $$QT_BUILD_TREE/imports/org/webkit/qmldir + qmldir.path += $$[QT_INSTALL_IMPORTS]/org/webkit + + INSTALLS += target qmldir +} |