summaryrefslogtreecommitdiff
path: root/src/webengine/plugin/experimental/plugin.cpp
diff options
context:
space:
mode:
authorArvid Nilsson <anilsson@blackberry.com>2013-11-28 15:29:40 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-04 14:23:33 +0100
commit5d66b66df1bc205a9ce3d25cfaaa84c961fa7a29 (patch)
treeb99b54d09ba93dbe66a65313c50ac6d831e5a8d0 /src/webengine/plugin/experimental/plugin.cpp
parent5d92938e5bb830b8ca5a711fd4c1999dd09fd0e3 (diff)
downloadqtwebengine-5d66b66df1bc205a9ce3d25cfaaa84c961fa7a29.tar.gz
Quick: Add experimental.viewport.devicePixelRatio
This specifies a devicePixelRatio to be used by web content instead of the QScreen::devicePixelRatio(). This is necessary on non-iOS mobile devices to remain compatible with the mobile web which assumes devicePixelRatio is computed as the ratio of actual dpi to 160 dpi. Non-iOS mobile platforms may use different criteria to determine the QScreen::devicePixelRatio(), depending on the history of the platform, or simply leave it at 1.0. For QNX, this setting gets a reasonable default value so developers don't have to regularly use this experimental API. These changes were inspired by the Android Chromium port which uses a GetDpiScale() to accomplish the same in content/browser/android/content_view_core_impl.cc. Change-Id: I1bc8878a47dabcdb6986c4fe5c8c4ac230ae2514 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/webengine/plugin/experimental/plugin.cpp')
-rw-r--r--src/webengine/plugin/experimental/plugin.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/webengine/plugin/experimental/plugin.cpp b/src/webengine/plugin/experimental/plugin.cpp
index 08d482508..6107147cf 100644
--- a/src/webengine/plugin/experimental/plugin.cpp
+++ b/src/webengine/plugin/experimental/plugin.cpp
@@ -69,6 +69,8 @@ public:
qmlRegisterExtendedType<QQuickWebEngineView, QQuickWebEngineViewExperimentalExtension>(uri, 1, 0, "WebEngineView");
qmlRegisterUncreatableType<QQuickWebEngineViewExperimental>(uri, 1, 0, "WebEngineViewExperimental",
QObject::tr("Cannot create a separate instance of WebEngineViewExperimental"));
+ qmlRegisterUncreatableType<QQuickWebEngineViewport>(uri, 1, 0, "WebEngineViewport",
+ QObject::tr("Cannot create a separate instance of WebEngineViewport"));
}
};