From dc16cdd60449112343d43852960142db7fd155fd Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 26 Aug 2015 13:44:45 +0200 Subject: Update WebEngineView documentation The split suggested in the comment does not work: You have to keep the complete documentation for a QML type in one file, the documentation bits in qquickwebengineview.cpp were silently ignored so far. This change moves over the bits from .cpp , adds missing documentation for new elements and sanitizes the output of others. Task-number: QTBUG-47909 Change-Id: Ie1ebb5a9fe952c7a76c8fe1b67135614ca90ce7a Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Leena Miettinen --- src/webengine/api/qquickwebengineview.cpp | 22 ---- .../doc/src/qquickwebengineview_lgpl.qdoc | 111 ++++++++++++++++++--- 2 files changed, 98 insertions(+), 35 deletions(-) diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 7405cae44..6c3452a6a 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -705,15 +705,6 @@ void QQuickWebEngineView::setProfile(QQuickWebEngineProfile *profile) Q_D(QQuickWebEngineView); d->setProfile(profile); } -/*! - * \qmlproperty WebEngineSettings QQuickWebEngineView::settings - * \readonly settings - * \since QtWebEngine 1.1 - * - * The \a settings property holds the settings used by this view. - * - * \sa WebEngineSettings - */ QQuickWebEngineSettings *QQuickWebEngineView::settings() const { @@ -903,19 +894,6 @@ QQuickWebEngineHistory *QQuickWebEngineView::navigationHistory() const return d->m_history.data(); } -/*! - * \qmlproperty QQmlWebChannel WebEngineView::webChannel - * \since QtWebEngine 1.1 - * - * The web channel instance used by this view. - * This channel is automatically using the internal QtWebEngine transport mechanism over Chromium IPC, - * and exposed in the javascript context of the page it is rendering as \c qt.webChannelTransport. - * This transport object is used when instantiating the JavaScript counterpart of QWebChannel using - * the \l{Qt WebChannel JavaScript API}. - * - * \note The view does not take ownership when explicitly setting a webChannel object. - */ - QQmlWebChannel *QQuickWebEngineView::webChannel() { Q_D(QQuickWebEngineView); diff --git a/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc b/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc index 075b595b5..212d9010a 100644 --- a/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc +++ b/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc @@ -21,8 +21,7 @@ */ // The documentation in this file was imported from QtWebKit and is thus constrained -// by its LGPL license. Documentation written from scratch for new methods should be -// placed inline in the code as usual. +// by its LGPL license. /*! \page qtwebengine-index.html @@ -96,6 +95,17 @@ This function is equivalent to the \c{window.history.forward()} DOM method. */ +/*! + \qmlmethod void WebEngineView::goBackOrForward(int offset) + \since QtWebEngine 1.1 + + If \a offset is positive, goes forward the specified number of offset + pages in the current session history. If offset is negative, it goes + back. If the offset is invalid, the page is not changed. + + \sa WebEngineView::goBack, WebEngineView::goForward +*/ + /*! \qmlmethod void WebEngineView::stop() @@ -107,6 +117,16 @@ Reloads the current page. This function is equivalent to the \c{window.location.reload()} DOM method. + + \sa WebEngineView::reloadAndBypassCache +*/ + +/*! + \qmlmethod void WebEngineView::reloadAndBypassCache() + + Reloads the current page, ignoring any cached content. + + \sa WebEngineView::reload */ /*! @@ -142,6 +162,7 @@ /*! \qmlproperty int WebEngineView::loadProgress + \readonly This property holds the amount of the page that has been loaded, expressed as an integer percentage in the range from \c{0} to \c{100}. @@ -149,6 +170,7 @@ /*! \qmlproperty bool WebEngineView::canGoBack + \readonly Returns \c{true} if there are prior session history entries, \c{false} otherwise. @@ -156,6 +178,7 @@ /*! \qmlproperty bool WebEngineView::canGoForward + \readonly Returns \c{true} if there are subsequent session history entries, \c{false} otherwise. @@ -163,6 +186,7 @@ /*! \qmlproperty bool WebEngineView::loading + \readonly Returns \c{true} if the HTML page is currently loading, \c{false} otherwise. */ @@ -182,7 +206,65 @@ Returns \c{true} if the web view is in fullscreen mode, \c{false} otherwise. - \sa WebEngineView::fullScreenRequested(), WebEngineView::fullScreenCancelled() + \sa WebEngineView::fullScreenRequested, WebEngineView::fullScreenCancelled +*/ + +/*! + \qmlproperty WebEngineHistory WebEngineView::navigationHistory + \since QtWebEngine 1.1 + \readonly + + The navigation history of the current view. + + \sa WebEngineHistory +*/ + +/*! + \qmlproperty QQmlWebChannel WebEngineView::webChannel + \since QtWebEngine 1.1 + + The web channel instance used by this view. + This channel is automatically using the internal QtWebEngine transport mechanism over Chromium IPC, + and exposed in the javascript context of the page it is rendering as \c qt.webChannelTransport. + This transport object is used when instantiating the JavaScript counterpart of QWebChannel using + the \l{Qt WebChannel JavaScript API}. + + \note The view does not take ownership for an assigned webChannel object. +*/ + +/*! + \qmlproperty WebEngineProfile WebEngineView::profile + \since QtWebEngine 1.1 + + The current profile used for the view. + + \sa WebEngineProfile +*/ + +/*! + \qmlproperty WebEngineSettings WebEngineView::settings + \readonly + \since QtWebEngine 1.1 + + Settings used by this view. + + \sa WebEngineSettings +*/ + + +/*! + \qmlproperty list WebEngineView::userScripts + \readonly + + List of script objects attached to the view. +*/ + +/*! + \qmlproperty real WebEngineView::zoomFactor + \since QtWebEngine 1.1 + + Zoom factor for the view. Valid values are within the range from \c{0.25} + to \c{5.0}. The default factor is \c{1.0}. */ /*! @@ -201,7 +283,6 @@ \sa WebEngineView::url */ - /*! \qmlmethod void WebEngineView::runJavaScript(string script, variant callback) \brief Runs the specified \a script in the content of the web view. @@ -255,13 +336,15 @@ */ /*! - \qmlmethod void WebEngineView::grantFeaturePermission(url securityOrigin, WebEngineView::Feature feature, bool granted) + \qmlmethod WebEngineView::grantFeaturePermission(url securityOrigin, Feature feature, bool granted) + \since QtWebEngine 1.1 Sets the permission for the web site identified by \a securityOrigin to use \a feature. - \sa featurePermissionRequested() + \sa WebEngineView::featurePermissionRequested */ + /*! \qmlmethod void WebEngineView::fullScreenCancelled() \since QtWebEngine 1.1 @@ -283,16 +366,16 @@ } \endcode - \sa WebEngineView::isFullScreen, WebEngineView::fullScreenRequested() + \sa WebEngineView::isFullScreen, WebEngineView::fullScreenRequested */ /*! - \qmlsignal void WebEngineView::featurePermissionRequested(url securityOrigin, WebEngineView::Feature feature) + \qmlsignal WebEngineView::featurePermissionRequested(url securityOrigin, Feature feature) This is signal is emitted when the web site identified by \a securityOrigin requests to make use of the resource or device identified by \a feature. - \sa grantFeaturePermission() + \sa WebEngineView::grantFeaturePermission */ /*! @@ -336,6 +419,7 @@ /*! \qmlsignal WebEngineView::certificateError(error) + \since QtWebEngine 1.1 This signal is emitted when an invalid certificate error is raised while loading a given request. @@ -380,6 +464,7 @@ /*! \qmlsignal WebEngineView::newViewRequested(request) + \since QtWebEngine 1.1 This signal is emitted when a page load is requested to happen in a separate WebEngineView. This can either be because the current page requested it explicitly @@ -399,7 +484,7 @@ */ /*! - \qmlsignal WebEngineView::fullScreenRequested(request) + \qmlsignal WebEngineView::fullScreenRequested(WebEngineFullScreenRequest request) \since QtWebEngine 1.1 This signal is emitted when the web page requests fullscreen mode through the @@ -415,7 +500,7 @@ This enumeration details various high-level error types. - \value NoErrorDomain + \value WebEngineView::NoErrorDomain \value WebEngineView::InternalErrorDomain Content fails to be interpreted by Qt WebEngine. \value WebEngineView::ConnectionErrorDomain @@ -522,7 +607,7 @@ \value MediaVideoCapture Video devices, e.g. cameras \value MediaAudioVideoCapture Both Audio and Video capture devices. - \sa featurePermissionRequested(), grantFeaturePermission() + \sa WebEngineView::featurePermissionRequested, WebEngineView::grantFeaturePermission */ @@ -569,5 +654,5 @@ } \endcode - \sa WebEngineFullScreenRequest::toggleOn() + \sa WebEngineFullScreenRequest::toggleOn */ -- cgit v1.2.3