summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTopi Reinio <topi.reinio@digia.com>2015-10-28 10:56:02 +0100
committerTopi Reiniƶ <topi.reinio@digia.com>2015-10-28 13:07:22 +0000
commita37fdfd9be608a1faea762d06b41eedfc8f8fc27 (patch)
tree3084b05cd92fb29651d4a027e5f42144594aa72e
parentdbee29818791503cd23276f7b20db79ab15350fe (diff)
Doc: Fix multiple documentation issues
- Document WebView.loadingChanged() signal - Use QT_VERSION everywhere in .qdocconf - Fix QDoc warnings, linking issues - Mark read-only QML properties as \readonly - Minor language edits Change-Id: Ieb9625d81aaee73a236222b85a496ee5783b644e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
-rw-r--r--src/webview/doc/qtwebview.qdocconf6
-rw-r--r--src/webview/qquickwebview.cpp48
-rw-r--r--src/webview/qquickwebviewloadrequest.cpp23
3 files changed, 51 insertions, 26 deletions
diff --git a/src/webview/doc/qtwebview.qdocconf b/src/webview/doc/qtwebview.qdocconf
index cd31d85..90a4170 100644
--- a/src/webview/doc/qtwebview.qdocconf
+++ b/src/webview/doc/qtwebview.qdocconf
@@ -11,9 +11,9 @@ qhp.QtWebView.namespace = org.qt-project.qtwebview.$QT_V
qhp.QtWebView.virtualFolder = qtwebview
qhp.QtWebView.indexTitle = Qt WebView
qhp.QtWebView.indexRoot =
-qhp.QtWebView.filterAttributes = qtwebview 1.0 qtrefdoc
-qhp.QtWebView.customFilters.Qt.name = QtWebView 1.0
-qhp.QtWebView.customFilters.Qt.filterAttributes = qtwebview 1.0
+qhp.QtWebView.filterAttributes = qtwebview $QT_VERSION qtrefdoc
+qhp.QtWebView.customFilters.Qt.name = QtWebView $QT_VERSION
+qhp.QtWebView.customFilters.Qt.filterAttributes = qtwebview $QT_VERSION
qhp.QtWebView.subprojects = classes qmltypes examples
qhp.QtWebView.subprojects.classes.selectors = namespace
diff --git a/src/webview/qquickwebview.cpp b/src/webview/qquickwebview.cpp
index 4d0045d..8a97d80 100644
--- a/src/webview/qquickwebview.cpp
+++ b/src/webview/qquickwebview.cpp
@@ -106,11 +106,11 @@ QQuickWebView::~QQuickWebView()
/*!
\qmlproperty url QtWebView::WebView::url
- The url of currently loaded web page. Changing this will trigger
+ The URL of currently loaded web page. Changing this will trigger
loading new content.
- The url is used as-is. Urls that originate from user input should
- be parsed with QUrl::fromUserInput.
+ The URL is used as-is. URLs that originate from user input should
+ be parsed with QUrl::fromUserInput().
*/
void QQuickWebView::setUrl(const QUrl &url)
@@ -120,6 +120,7 @@ void QQuickWebView::setUrl(const QUrl &url)
/*!
\qmlproperty string QtWebView::WebView::title
+ \readonly
The title of the currently loaded web page.
*/
@@ -136,8 +137,9 @@ QUrl QQuickWebView::url() const
/*!
\qmlproperty bool QtWebView::WebView::canGoBack
+ \readonly
- True if it's currently possible to navigate back in the web history.
+ Holds \c true if it's currently possible to navigate back in the web history.
*/
bool QQuickWebView::canGoBack() const
@@ -147,8 +149,9 @@ bool QQuickWebView::canGoBack() const
/*!
\qmlproperty bool QtWebView::WebView::canGoForward
+ \readonly
- True if it's currently possible to navigate forward in the web history.
+ Holds \c true if it's currently possible to navigate forward in the web history.
*/
bool QQuickWebView::canGoForward() const
@@ -158,6 +161,7 @@ bool QQuickWebView::canGoForward() const
/*!
\qmlproperty int QtWebView::WebView::loadProgress
+ \readonly
The current load progress of the web content, represented as
an integer between 0 and 100.
@@ -169,9 +173,26 @@ int QQuickWebView::loadProgress() const
/*!
\qmlproperty bool QtWebView::WebView::loading
+ \readonly
- True if the WebView is currently in the process of loading
- new content, and false if not.
+ Holds \c true if the WebView is currently in the process of loading
+ new content, \c false otherwise.
+
+ \sa loadingChanged()
+*/
+
+/*!
+ \qmlsignal QtWebView::WebView::loadingChanged(WebViewLoadRequest loadRequest)
+
+ This signal is emitted when the state of loading the web content changes.
+ By handling this signal it's possible, for example, to react to page load
+ errors.
+
+ The \a loadRequest parameter holds the \e url and \e status of the request,
+ as well as an \e errorString containing an error message for a failed
+ request.
+
+ \sa WebViewLoadRequest
*/
bool QQuickWebView::isLoading() const
{
@@ -201,7 +222,7 @@ void QQuickWebView::goForward()
/*!
\qmlmethod void QtWebView::WebView::reload()
- Reloads the current url.
+ Reloads the current \l url.
*/
void QQuickWebView::reload()
{
@@ -211,7 +232,7 @@ void QQuickWebView::reload()
/*!
\qmlmethod void QtWebView::WebView::stop()
- Stops loading the current url.
+ Stops loading the current \l url.
*/
void QQuickWebView::stop()
{
@@ -223,16 +244,16 @@ void QQuickWebView::stop()
Loads the specified \a html content to the web view.
- This method offers a lower-level alternative to the \c{url} property,
+ This method offers a lower-level alternative to the \l url property,
which references HTML pages via URL.
External objects such as stylesheets or images referenced in the HTML
document should be located relative to \a baseUrl. For example, if \a html
is retrieved from \c http://www.example.com/documents/overview.html, which
- is the base url, then an image referenced with the relative url, \c diagram.png,
+ is the base URL, then an image referenced with the relative url, \c diagram.png,
should be at \c{http://www.example.com/documents/diagram.png}.
- \sa QtWebView::WebView::url
+ \sa url
*/
void QQuickWebView::loadHtml(const QString &html, const QUrl &baseUrl)
{
@@ -243,7 +264,8 @@ void QQuickWebView::loadHtml(const QString &html, const QUrl &baseUrl)
\qmlmethod void QtWebView::WebView::runJavaScript(string script, variant callback)
Runs the specified JavaScript.
- In case a callback function is provided, it will be invoked after the script finished running.
+ In case a \a callback function is provided, it will be invoked after the \a script
+ finished running.
\badcode
runJavaScript("document.title", function(result) { console.log(result); });
diff --git a/src/webview/qquickwebviewloadrequest.cpp b/src/webview/qquickwebviewloadrequest.cpp
index b504560..cdeb3e9 100644
--- a/src/webview/qquickwebviewloadrequest.cpp
+++ b/src/webview/qquickwebviewloadrequest.cpp
@@ -44,11 +44,11 @@ QT_BEGIN_NAMESPACE
\instantiates QQuickWebViewLoadRequest
\inqmlmodule QtWebView
- \brief A utility class for the QtWebView::WebView::loadingChanged signal.
+ \brief A utility type for \l {WebView}'s \l {WebView::}{loadingChanged()} signal.
- This class contains load status information for the requested URL.
+ The WebViewLoadRequest type contains load status information for the requested URL.
- \sa QtWebView::WebView::loadingChanged
+ \sa {WebView::loadingChanged()}{WebView.loadingChanged()}
*/
QQuickWebViewLoadRequest::QQuickWebViewLoadRequest(const QWebViewLoadRequestPrivate &d)
: d_ptr(new QWebViewLoadRequestPrivate(d))
@@ -62,7 +62,8 @@ QQuickWebViewLoadRequest::~QQuickWebViewLoadRequest()
}
/*!
- \qmlproperty url QtWebView::WebView::WebViewLoadRequest::url
+ \qmlproperty url QtWebView::WebViewLoadRequest::url
+ \readonly
The URL of the load request.
*/
@@ -74,14 +75,15 @@ QUrl QQuickWebViewLoadRequest::url() const
/*!
\qmlproperty enumeration WebViewLoadRequest::status
+ \readonly
This enumeration represents the load status of a web page load request.
- \value QtWebView::WebView::LoadStartedStatus The page is currently loading.
- \value QtWebView::WebView::LoadSucceededStatus The page was loaded successfully.
- \value QtWebView::WebView::LoadFailedStatus The page could not be loaded.
+ \value WebView.LoadStartedStatus The page is currently loading.
+ \value WebView.LoadSucceededStatus The page was loaded successfully.
+ \value WebView.LoadFailedStatus The page could not be loaded.
- \sa QtWebView::WebView::loadingChanged
+ \sa {WebView::loadingChanged()}{WebView.loadingChanged}
*/
QQuickWebView::LoadStatus QQuickWebViewLoadRequest::status() const
{
@@ -90,9 +92,10 @@ QQuickWebView::LoadStatus QQuickWebViewLoadRequest::status() const
}
/*!
- \qmlproperty string QtWebView::WebView::WebViewLoadRequest::errorString
+ \qmlproperty string QtWebView::WebViewLoadRequest::errorString
+ \readonly
- Holds the error message if the load request fails.
+ Holds the error message if the load request failed.
*/
QString QQuickWebViewLoadRequest::errorString() const
{