summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf3
-rw-r--r--src/core/core_gyp_generator.pro1
-rw-r--r--src/core/web_engine_context.cpp2
-rw-r--r--src/webengine/plugin/plugin.cpp19
-rw-r--r--tests/quicktestbrowser/FeaturePermissionBar.qml2
-rw-r--r--tests/quicktestbrowser/quickwindow.qml2
6 files changed, 21 insertions, 8 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 9f986403f..aecb86d1c 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -2,5 +2,4 @@ QMAKEPATH += $$PWD/tools/qmake
load(qt_build_config)
CONFIG += qt_example_installs
-# All modules share the same version number. We plan on following Qt's releases for now.
-MODULE_VERSION = 5.2.0
+MODULE_VERSION = 0.9.0
diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro
index 2f58664f4..4ac4d0060 100644
--- a/src/core/core_gyp_generator.pro
+++ b/src/core/core_gyp_generator.pro
@@ -17,6 +17,7 @@ QT_PRIVATE += qml-private quick-private gui-private core-private
DEFINES += QT_NO_KEYWORDS \
Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS \
QTWEBENGINEPROCESS_NAME=\\\"$$QTWEBENGINEPROCESS_NAME\\\" \
+ QTWEBENGINECORE_VERSION_STR=\\\"$$MODULE_VERSION\\\" \
BUILDING_CHROMIUM
# Keep Skia happy
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index feec45e90..8af675b81 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -130,7 +130,7 @@ WebEngineContext::WebEngineContext()
CommandLine* parsedCommandLine = CommandLine::ForCurrentProcess();
// Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
- parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/0.1 Chrome/" CHROMIUM_VERSION));
+ parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION));
parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
parsedCommandLine->AppendSwitch(switches::kNoSandbox);
parsedCommandLine->AppendSwitch(switches::kDisablePlugins);
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp
index 2408e5c8e..811f85dde 100644
--- a/src/webengine/plugin/plugin.cpp
+++ b/src/webengine/plugin/plugin.cpp
@@ -41,12 +41,17 @@
#include <QtQml/qqmlextensionplugin.h>
+#include "qtwebengineversion.h"
#include "qquickwebengineview_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebenginenewviewrequest_p.h"
QT_BEGIN_NAMESPACE
+class QQuickWebEngineVersionBumper : public QObject {
+ Q_OBJECT
+};
+
class QtWebEnginePlugin : public QQmlExtensionPlugin
{
Q_OBJECT
@@ -56,9 +61,17 @@ public:
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine"));
- qmlRegisterType<QQuickWebEngineView>(uri, 1, 0, "WebEngineView");
- qmlRegisterUncreatableType<QQuickWebEngineLoadRequest>(uri, 1, 0, "WebEngineLoadRequest", QObject::tr("Cannot create separate instance of WebEngineLoadRequest"));
- qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 1, 0, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest"));
+ qmlRegisterType<QQuickWebEngineView>(uri, 0, 9, "WebEngineView");
+ qmlRegisterUncreatableType<QQuickWebEngineLoadRequest>(uri, 0, 9, "WebEngineLoadRequest", QObject::tr("Cannot create separate instance of WebEngineLoadRequest"));
+ qmlRegisterUncreatableType<QQuickWebEngineNewViewRequest>(uri, 0, 9, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest"));
+
+ // The QML type loader relies on the minimum and maximum minor version of registered types
+ // to validate imports. We want to tie our import version to the module version, so register
+ // a dummy type in order to allow importing the latest version even if it didn't include
+ // an API update that would appear here in a registered type.
+ int major = QTWEBENGINE_VERSION >> 16;
+ int minor = QTWEBENGINE_VERSION >> 8;
+ qmlRegisterUncreatableType<QQuickWebEngineVersionBumper>(uri, major, minor, "WebEngineVersionBumper", QObject::tr("This is a dummy type and cannot be created."));
}
};
diff --git a/tests/quicktestbrowser/FeaturePermissionBar.qml b/tests/quicktestbrowser/FeaturePermissionBar.qml
index dd2e0f714..9b248e31f 100644
--- a/tests/quicktestbrowser/FeaturePermissionBar.qml
+++ b/tests/quicktestbrowser/FeaturePermissionBar.qml
@@ -40,7 +40,7 @@
import QtQuick 2.1
import QtQuick.Controls 1.0
-import QtWebEngine 1.0
+import QtWebEngine 0.9
import QtWebEngine.experimental 1.0
import QtQuick.Layouts 1.0
diff --git a/tests/quicktestbrowser/quickwindow.qml b/tests/quicktestbrowser/quickwindow.qml
index f08469dda..1e54bb429 100644
--- a/tests/quicktestbrowser/quickwindow.qml
+++ b/tests/quicktestbrowser/quickwindow.qml
@@ -39,7 +39,7 @@
****************************************************************************/
import QtQuick 2.1
-import QtWebEngine 1.0
+import QtWebEngine 0.9
import QtWebEngine.experimental 1.0
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0