summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2016-09-20 03:51:55 -0700
committerSzabolcs David <davidsz@inf.u-szeged.hu>2016-09-22 15:55:07 +0000
commita4dcc5b4894aac423f65fcf9a13394078ee72257 (patch)
treed66fca41eaee4a194a339d8d1e3ddd03be6860d8
parenta7a7eb4c525a4fb78a3f0f1205262b147304261d (diff)
Remove experimental Quick API
QtWebEngine.experimental import is not working. It is better to get rid of that. It also removes some QNX-specific code. Change-Id: If80c1290b4d5f5e4d436c49bd7d7a6ea882ee6db Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
-rw-r--r--src/src.pro4
-rw-r--r--src/webengine/api/qquickwebengineview.cpp86
-rw-r--r--src/webengine/api/qquickwebengineview_p.h7
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h46
-rw-r--r--src/webengine/plugin/experimental/experimental.pro13
-rw-r--r--src/webengine/plugin/experimental/plugin.cpp79
-rw-r--r--src/webengine/plugin/experimental/qmldir3
7 files changed, 2 insertions, 236 deletions
diff --git a/src/src.pro b/src/src.pro
index 00e8301b..dc6bc527 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -6,15 +6,11 @@ webenginewidgets.depends = core webengine
webengine_plugin.subdir = webengine/plugin
webengine_plugin.target = sub-webengine-plugin
webengine_plugin.depends = webengine
-webengine_experimental_plugin.subdir = webengine/plugin/experimental
-webengine_experimental_plugin.target = sub-webengine-experimental-plugin
-webengine_experimental_plugin.depends = webengine
SUBDIRS += core \
process \
webengine \
webengine_plugin \
- webengine_experimental_plugin \
plugins
# allow only desktop builds of qwebengine_convert_dict
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index fd1e746a..2876e4fb 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -127,8 +127,6 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje
QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
: adapter(0)
- , e(new QQuickWebEngineViewExperimental(this))
- , v(new QQuickWebEngineViewport(this))
, m_history(new QQuickWebEngineHistory(this))
, m_profile(QQuickWebEngineProfile::defaultProfile())
, m_settings(new QQuickWebEngineSettings(m_profile->settings()))
@@ -149,23 +147,7 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
, m_defaultZoomFactor(1.0)
, m_ui2Enabled(false)
{
- // The gold standard for mobile web content is 160 dpi, and the devicePixelRatio expected
- // is the (possibly quantized) ratio of device dpi to 160 dpi.
- // However GUI toolkits on non-iOS platforms may be using different criteria than relative
- // DPI (depending on the history of that platform), dictating the choice of
- // QScreen::devicePixelRatio().
- // Where applicable (i.e. non-iOS mobile platforms), override QScreen::devicePixelRatio
- // and instead use a reasonable default value for viewport.devicePixelRatio to avoid every
- // app having to use this experimental API.
QString platform = qApp->platformName().toLower();
- if (platform == QLatin1String("qnx")) {
- qreal webPixelRatio = QGuiApplication::primaryScreen()->physicalDotsPerInch() / 160;
-
- // Quantize devicePixelRatio to increments of 1 to allow JS and media queries to select
- // 1x, 2x, 3x etc assets that fit an integral number of pixels.
- setDevicePixelRatio(qMax(1, qRound(webPixelRatio)));
- }
-
if (platform == QLatin1Literal("eglfs"))
m_ui2Enabled = true;
@@ -194,16 +176,6 @@ QQuickWebEngineViewPrivate::~QQuickWebEngineViewPrivate()
{
}
-QQuickWebEngineViewExperimental *QQuickWebEngineViewPrivate::experimental() const
-{
- return e.data();
-}
-
-QQuickWebEngineViewport *QQuickWebEngineViewPrivate::viewport() const
-{
- return v.data();
-}
-
UIDelegatesManager *QQuickWebEngineViewPrivate::ui()
{
Q_Q(QQuickWebEngineView);
@@ -891,7 +863,7 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
, d_ptr(new QQuickWebEngineViewPrivate)
{
Q_D(QQuickWebEngineView);
- d->e->q_ptr = d->q_ptr = this;
+ d->q_ptr = this;
this->setActiveFocusOnTab(true);
this->setFlags(QQuickItem::ItemIsFocusScope | QQuickItem::ItemAcceptsInputMethod
| QQuickItem::ItemAcceptsDrops);
@@ -1266,12 +1238,6 @@ void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId,
d->adapter->runJavaScript(script, worldId);
}
-QQuickWebEngineViewExperimental *QQuickWebEngineView::experimental() const
-{
- Q_D(const QQuickWebEngineView);
- return d->e.data();
-}
-
qreal QQuickWebEngineView::zoomFactor() const
{
Q_D(const QQuickWebEngineView);
@@ -1380,19 +1346,6 @@ bool QQuickWebEngineView::isFullScreen() const
return d->m_fullscreenMode;
}
-void QQuickWebEngineViewExperimental::setExtraContextMenuEntriesComponent(QQmlComponent *contextMenuExtras)
-{
- if (d_ptr->contextMenuExtraItems == contextMenuExtras)
- return;
- d_ptr->contextMenuExtraItems = contextMenuExtras;
- emit extraContextMenuEntriesComponentChanged();
-}
-
-QQmlComponent *QQuickWebEngineViewExperimental::extraContextMenuEntriesComponent() const
-{
- return d_ptr->contextMenuExtraItems;
-}
-
void QQuickWebEngineView::findText(const QString &subString, FindFlags options, const QJSValue &callback)
{
Q_D(QQuickWebEngineView);
@@ -1825,42 +1778,5 @@ void QQuickWebEngineFullScreenRequest::reject()
m_viewPrivate->setFullScreenMode(!m_toggleOn);
}
-QQuickWebEngineViewExperimental::QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate *viewPrivate)
- : q_ptr(0)
- , d_ptr(viewPrivate)
-{
-}
-
-QQuickWebEngineViewport *QQuickWebEngineViewExperimental::viewport() const
-{
- Q_D(const QQuickWebEngineView);
- return d->viewport();
-}
-
-QQuickWebEngineViewport::QQuickWebEngineViewport(QQuickWebEngineViewPrivate *viewPrivate)
- : d_ptr(viewPrivate)
-{
-}
-
-qreal QQuickWebEngineViewport::devicePixelRatio() const
-{
- Q_D(const QQuickWebEngineView);
- return d->devicePixelRatio;
-}
-
-void QQuickWebEngineViewport::setDevicePixelRatio(qreal devicePixelRatio)
-{
- Q_D(QQuickWebEngineView);
- // Valid range is [1, inf)
- devicePixelRatio = qMax(qreal(1.0), devicePixelRatio);
- if (d->devicePixelRatio == devicePixelRatio)
- return;
- d->setDevicePixelRatio(devicePixelRatio);
- if (!d->adapter)
- return;
- d->adapter->dpiScaleChanged();
- Q_EMIT devicePixelRatioChanged();
-}
-
QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 1d44a48d..64894d88 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -73,7 +73,6 @@ class QQuickWebEngineNewViewRequest;
class QQuickWebEngineProfile;
class QQuickWebEngineSettings;
class QQuickWebEngineFormValidationMessageRequest;
-class QQuickWebEngineViewExperimental;
class QQuickWebEngineViewPrivate;
#ifdef ENABLE_QML_TESTSUPPORT_API
@@ -153,13 +152,11 @@ public:
QPointF scrollPosition() const;
bool canViewSource() const;
- QQuickWebEngineViewExperimental *experimental() const;
-
// must match WebContentsAdapterClient::NavigationRequestAction
enum NavigationRequestAction {
AcceptRequest,
// Make room in the valid range of the enum so
- // we can expose extra actions in experimental.
+ // we can expose extra actions.
IgnoreRequest = 0xFF
};
Q_ENUM(NavigationRequestAction)
@@ -530,8 +527,6 @@ private:
Q_DECLARE_PRIVATE(QQuickWebEngineView)
QScopedPointer<QQuickWebEngineViewPrivate> d_ptr;
- friend class QQuickWebEngineViewExperimental;
- friend class QQuickWebEngineViewExperimentalExtension;
friend class QQuickWebEngineNewViewRequest;
friend class QQuickWebEngineFaviconProvider;
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index c6ff1837..b111e92c 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -79,45 +79,6 @@ QQuickWebEngineView::WebAction editorActionForKeyEvent(QKeyEvent* event);
class QQuickWebEngineTestSupport;
#endif
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewport : public QObject {
- Q_OBJECT
- Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged)
-public:
- QQuickWebEngineViewport(QQuickWebEngineViewPrivate *viewPrivate);
-
- qreal devicePixelRatio() const;
- void setDevicePixelRatio(qreal);
-
-Q_SIGNALS:
- void devicePixelRatioChanged();
-
-private:
- QQuickWebEngineViewPrivate *d_ptr;
-
- Q_DECLARE_PRIVATE(QQuickWebEngineView)
-};
-
-class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewExperimental : public QObject {
- Q_OBJECT
- Q_PROPERTY(QQuickWebEngineViewport *viewport READ viewport)
- Q_PROPERTY(QQmlComponent *extraContextMenuEntriesComponent READ extraContextMenuEntriesComponent WRITE setExtraContextMenuEntriesComponent NOTIFY extraContextMenuEntriesComponentChanged)
-
- QQuickWebEngineViewport *viewport() const;
- void setExtraContextMenuEntriesComponent(QQmlComponent *);
- QQmlComponent *extraContextMenuEntriesComponent() const;
-
-Q_SIGNALS:
- void extraContextMenuEntriesComponentChanged();
-
-private:
- QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate* viewPrivate);
- QQuickWebEngineView *q_ptr;
- QQuickWebEngineViewPrivate *d_ptr;
-
- Q_DECLARE_PRIVATE(QQuickWebEngineView)
- Q_DECLARE_PUBLIC(QQuickWebEngineView)
-};
-
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewPrivate : public QtWebEngineCore::WebContentsAdapterClient
{
public:
@@ -126,8 +87,6 @@ public:
QQuickWebEngineViewPrivate();
~QQuickWebEngineViewPrivate();
- QQuickWebEngineViewExperimental *experimental() const;
- QQuickWebEngineViewport *viewport() const;
QtWebEngineCore::UIDelegatesManager *ui();
virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE;
@@ -208,8 +167,6 @@ public:
static void userScripts_clear(QQmlListProperty<QQuickWebEngineScript> *p);
QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter;
- QScopedPointer<QQuickWebEngineViewExperimental> e;
- QScopedPointer<QQuickWebEngineViewport> v;
QScopedPointer<QQuickWebEngineHistory> m_history;
QQuickWebEngineProfile *m_profile;
QScopedPointer<QQuickWebEngineSettings> m_settings;
@@ -260,7 +217,4 @@ private:
#endif // QT_NO_ACCESSIBILITY
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickWebEngineViewExperimental)
-QML_DECLARE_TYPE(QQuickWebEngineViewport)
-
#endif // QQUICKWEBENGINEVIEW_P_P_H
diff --git a/src/webengine/plugin/experimental/experimental.pro b/src/webengine/plugin/experimental/experimental.pro
deleted file mode 100644
index d1b59326..00000000
--- a/src/webengine/plugin/experimental/experimental.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-CXX_MODULE = qml
-TARGET = qtwebengineexperimentalplugin
-TARGETPATH = QtWebEngine/experimental
-IMPORT_VERSION = 1.0
-
-QT += webengine qml quick
-QT_PRIVATE += webengine-private
-
-INCLUDEPATH += $$QTWEBENGINE_ROOT/src/core $$QTWEBENGINE_ROOT/src/core/api $$QTWEBENGINE_ROOT/src/webengine $$QTWEBENGINE_ROOT/src/webengine/api
-
-SOURCES = plugin.cpp
-
-load(qml_plugin)
diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp
deleted file mode 100644
index d9043f6d..00000000
--- a/src/webengine/plugin/experimental/plugin.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtWebEngine module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <QtQml/qqmlextensionplugin.h>
-
-#include "qquickwebengineview_p.h"
-#include "qquickwebengineview_p_p.h"
-
-QT_BEGIN_NAMESPACE
-
-class QQuickWebEngineViewExperimentalExtension : public QObject {
- Q_OBJECT
- Q_PROPERTY(QQuickWebEngineViewExperimental* experimental READ experimental CONSTANT FINAL)
-public:
- QQuickWebEngineViewExperimentalExtension(QObject *parent = 0) : QObject(parent) { }
- QQuickWebEngineViewExperimental* experimental() { return static_cast<QQuickWebEngineView*>(parent())->d_func()->experimental(); }
-};
-
-class QtWebEngineExperimentalPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-public:
- virtual void registerTypes(const char *uri)
- {
- qWarning("\nWARNING: This project is using the experimental QML API extensions for QtWebEngine and is therefore tied to a specific QtWebEngine release.\n"
- "WARNING: The experimental API will change from version to version, or even be removed. You have been warned!\n");
-
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine.experimental"));
-
- qmlRegisterExtendedType<QQuickWebEngineView, QQuickWebEngineViewExperimentalExtension>(uri, 1, 0, "WebEngineView");
- qmlRegisterUncreatableType<QQuickWebEngineViewExperimental>(uri, 1, 0, "WebEngineViewExperimental",
- tr("Cannot create a separate instance of WebEngineViewExperimental"));
- qmlRegisterUncreatableType<QQuickWebEngineViewport>(uri, 1, 0, "WebEngineViewport",
- tr("Cannot create a separate instance of WebEngineViewport"));
- // Use the latest revision of QQuickWebEngineView when importing QtWebEngine.experimental 1.0
- qmlRegisterRevision<QQuickWebEngineView, LATEST_WEBENGINEVIEW_REVISION>(uri, 1, 1);
- }
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
diff --git a/src/webengine/plugin/experimental/qmldir b/src/webengine/plugin/experimental/qmldir
deleted file mode 100644
index 56ad22e7..00000000
--- a/src/webengine/plugin/experimental/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module QtWebEngine.experimental
-plugin qtwebengineexperimentalplugin
-typeinfo plugins.qmltypes