From 5e0104030ba3210789c5f7203cc7996dcef71cac Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Thu, 5 Feb 2015 06:58:11 -0800 Subject: Proper versioning of the Quick API - Add missing "REVISION 1" to the new parts of the API: zoomFactor, certificateError and profile. - setZoomFactor should not be a slot. Change-Id: I02551ee7eb7323ff8dbb0b62ea503ed08b2051c2 Reviewed-by: Andras Becsi --- src/webengine/api/qquickwebengineview_p.h | 10 +++++----- src/webengine/plugin/plugin.cpp | 2 +- tests/auto/quick/publicapi/tst_publicapi.cpp | 1 - 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index b8f2fb896..56a1b47ab 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -60,8 +60,8 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem { Q_PROPERTY(QString title READ title NOTIFY titleChanged) Q_PROPERTY(bool canGoBack READ canGoBack NOTIFY urlChanged) Q_PROPERTY(bool canGoForward READ canGoForward NOTIFY urlChanged) - Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged) - Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile FINAL) + Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor NOTIFY zoomFactorChanged REVISION 1) + Q_PROPERTY(QQuickWebEngineProfile *profile READ profile WRITE setProfile FINAL REVISION 1) Q_PROPERTY(QQuickWebEngineSettings *settings READ settings REVISION 1) Q_ENUMS(NavigationRequestAction); Q_ENUMS(NavigationType); @@ -83,6 +83,7 @@ public: bool canGoBack() const; bool canGoForward() const; qreal zoomFactor() const; + void setZoomFactor(qreal arg); QQuickWebEngineViewExperimental *experimental() const; @@ -150,7 +151,6 @@ public Q_SLOTS: void goForward(); void reload(); void stop(); - void setZoomFactor(qreal arg); Q_SIGNALS: void titleChanged(); @@ -161,9 +161,9 @@ Q_SIGNALS: void linkHovered(const QUrl &hoveredUrl); void navigationRequested(QQuickWebEngineNavigationRequest *request); void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID); - void zoomFactorChanged(qreal arg); - void certificateError(QQuickWebEngineCertificateError *error); + Q_REVISION(1) void certificateError(QQuickWebEngineCertificateError *error); Q_REVISION(1) void newViewRequested(QQuickWebEngineNewViewRequest *request); + Q_REVISION(1) void zoomFactorChanged(qreal arg); protected: void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry); diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index 486151b04..1a7474132 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -61,12 +61,12 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine")); qmlRegisterType(uri, 1, 0, "WebEngineView"); - qmlRegisterUncreatableType(uri, 1, 1, "WebEngineCertificateError", QObject::tr("Cannot create separate instance of WebEngineCertificateError")); qmlRegisterUncreatableType(uri, 1, 0, "WebEngineLoadRequest", QObject::tr("Cannot create separate instance of WebEngineLoadRequest")); qmlRegisterUncreatableType(uri, 1, 0, "WebEngineNavigationRequest", QObject::tr("Cannot create separate instance of WebEngineNavigationRequest")); qmlRegisterType(uri, 1, 1, "WebEngineView"); qmlRegisterType(uri, 1, 1, "WebEngineProfile"); + qmlRegisterUncreatableType(uri, 1, 1, "WebEngineCertificateError", QObject::tr("Cannot create separate instance of WebEngineCertificateError")); qmlRegisterUncreatableType(uri, 1, 1, "WebEngineNewViewRequest", QObject::tr("Cannot create separate instance of WebEngineNewViewRequest")); qmlRegisterUncreatableType(uri, 1, 1, "WebEngineSettings", QObject::tr("Cannot create a separate instance of WebEngineSettings")); } diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index 269bbf0b5..4b143d2bd 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -142,7 +142,6 @@ static QStringList expectedAPI = QStringList() << "QQuickWebEngineView.reload() --> void" << "QQuickWebEngineView.zoomFactor --> double" << "QQuickWebEngineView.zoomFactorChanged(double) --> void" - << "QQuickWebEngineView.setZoomFactor(double) --> void" << "QQuickWebEngineView.profile --> QQuickWebEngineProfile*" << "QQuickWebEngineView.newViewRequested(QQuickWebEngineNewViewRequest*) --> void" << "QQuickWebEngineDownloadItem.id --> uint" -- cgit v1.2.3