summaryrefslogtreecommitdiffstats
path: root/src/webengine
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-05-09 16:59:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-16 13:26:00 +0200
commit9e4cbda50ad3b3bc4b7911f5ec8e2591103e997f (patch)
tree10d95e73a76b0228ec2fbfbe49d0b0b2376b0406 /src/webengine
parent05395aa55978ab4cd46916c63f032adf3a1c1587 (diff)
Set the QtWebEngine modules version to 0.9.0
Also make sure that this version number appears in the user agent string and in the QML imports. The plan, unlike other Qt modules, is to keep our module and QML versions in sync to make it easy for developers to figure out what API is available in a given version. The QTWEBENGINECORE_VERSION_STR define is explicitly set in the .pro file since we don't call syncqt to generate a version header for the core module. The 0-major version currently causes the library name to start with libQt0 instead of libQt5, but this is something that we can fix in qtbase once we want to officially support linux desktop with QtWebEngine 1.0.0. Change-Id: I31915e84869b4db456416ef1f85a2296b8a06c99 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/plugin/plugin.cpp19
1 files changed, 16 insertions, 3 deletions
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."));
}
};