summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2015-10-06 13:49:09 +0200
committerLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>2015-10-06 12:00:50 +0000
commita81a3f4d06b48e5dbe56ba8f3db48d5ed4fab7c7 (patch)
treedf2e6950fd92ce4119e66937ec63ed89088e87cc /src/webenginewidgets
parente0f8746d7da0d8c26e84472da03399ea337fc5af (diff)
Doc: edit QWebEngineView docs
Fix grammar, style, and punctuation. Change-Id: I0d6a8f9ccda16c81f7bc32194d09c5ca0e8761ce Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc105
1 files changed, 48 insertions, 57 deletions
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 76878e077..9d03527e1 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -33,57 +33,48 @@
\inmodule QtWebEngineWidgets
- QWebEngineView is the main widget component of the Qt WebEngine web browsing module.
+ A \e {web view} is the main widget component of the Qt WebEngine web browsing module.
It can be used in various applications to display web content live from the
Internet.
- A web site can be loaded onto QWebEngineView with the load() function. Like all
+ A \e {web site} can be loaded to a web view with the load() function. Like all
Qt widgets, the show() function must be invoked in order to display
- QWebEngineView. The snippet below illustrates this:
+ the web view. The snippet below illustrates this:
\snippet simple/main.cpp Using QWebEngineView
- Alternatively, setUrl() can also be used to load a web site. If you have
+ Alternatively, setUrl() can be used to load a web site. If you have
the HTML content readily available, you can use setHtml() instead.
- The loadStarted() signal is emitted when the view begins loading. The
- loadProgress() signal, on the other hand, is emitted whenever an element of
- the web view completes loading, such as an embedded image, a script, etc.
- Finally, the loadFinished() signal is emitted when the view has loaded
- completely. It's argument - either \c true or \c false - indicates
- load success or failure.
+ The loadStarted() signal is emitted when the view begins loading and the loadProgress()
+ signal is emitted whenever an element of the web view completes loading, such as an embedded
+ image or a script. The loadFinished() signal is emitted when the view has been loaded
+ completely. Its argument, either \c true or \c false, indicates whether loading was
+ successful or failed.
- The page() function returns a pointer to the web page object. See
- \l{Elements of QWebEngineView} for an explanation of how the web page
- is related to the view.
+ The page() function returns a pointer to a \e {web page} object. A QWebEngineView contains a
+ QWebEnginePage, which in turn allows access to the QWebEngineHistory in the page's context.
The title of an HTML document can be accessed with the title() property.
- Additionally, a web site may also specify an icon, which can be accessed
+ Additionally, a web site may specify an icon, which can be accessed
using the iconUrl() property. If the title or the icon changes, the corresponding
titleChanged() and iconUrlChanged() signals will be emitted. The
- textSizeMultiplier() property can be used to change the overall size of
- the text displayed in the web view.
+ zoomFactor() property can be used to change the overall size of the contents of the web view.
If you require a custom context menu, you can implement it by reimplementing
\l{QWidget::}{contextMenuEvent()} and populating your QMenu with the actions
- obtained from pageAction(). More functionality such as reloading the view,
- copying selected text to the clipboard, or pasting into the view, is also
+ obtained from pageAction(). Additional functionality, such as reloading the view,
+ copying selected text to the clipboard, or pasting into the view, is
encapsulated within the QAction objects returned by pageAction(). These
actions can be programmatically triggered using triggerPageAction().
Alternatively, the actions can be added to a toolbar or a menu directly.
- QWebEngineView maintains the state of the returned actions but allows
+ The web view maintains the state of the returned actions but allows
modification of action properties such as \l{QAction::}{text} or
\l{QAction::}{icon}.
If you want to provide support for web sites that allow the user to open
new windows, such as pop-up windows, you can subclass QWebEngineView and
reimplement the createWindow() function.
-
- \section1 Elements of QWebEngineView
-
- QWebEngineView contains a QWebEnginePage, which in turn allows access to the
- QWebEngineHistory in the page's context.
-
*/
// FIXME: reintroduce the following when we have proper names for the examples.
// \sa {WebEngine Tab Browser Example}, {WebEngine Fancy Browser Example}
@@ -91,7 +82,7 @@
/*!
\fn QWebEngineView::QWebEngineView(QWidget *parent)
- Constructs an empty QWebEngineView with parent \a parent.
+ Constructs an empty web view with the parent \a parent.
\sa load()
*/
@@ -123,29 +114,29 @@
\fn void QWebEngineView::load(const QUrl &url)
Loads the specified \a url and displays it.
- \note The view remains the same until enough data has arrived to display the new \a url.
+ \note The view remains the same until enough data has arrived to display the new URL.
\sa setUrl(), url(), urlChanged(), QUrl::fromUserInput()
*/
/*!
\fn void QWebEngineView::setHtml(const QString &html, const QUrl &baseUrl)
- Sets the content of the web view to the specified \a html.
+ Sets the content of the web view to the specified \a html content.
- External objects such as stylesheets or images referenced in the HTML
- document are located relative to \a baseUrl.
+ External objects, such as stylesheets or images referenced in the HTML
+ document, are located relative to \a baseUrl.
- The \a html is loaded immediately; external objects are loaded asynchronously.
+ The HTML document is loaded immediately, whereas external objects are loaded asynchronously.
- When using this method, Qt WebEngine assumes that external resources such as
- JavaScript programs or style sheets are encoded in UTF-8 unless otherwise
+ When using this method, Qt WebEngine assumes that external resources, such as
+ JavaScript programs or style sheets, are encoded in UTF-8 unless otherwise
specified. For example, the encoding of an external script can be specified
- through the charset attribute of the HTML script tag. Alternatively, the
- encoding can also be specified by the web server.
+ through the \c charset attribute of the HTML script tag. Alternatively, the
+ encoding can be specified by the web server.
This is a convenience function equivalent to setContent(html, "text/html", baseUrl).
- \warning This function works only for HTML, for other mime types (i.e. XHTML, SVG)
+ \warning This function works only for HTML. For other MIME types (such as XHTML or SVG),
setContent() should be used instead.
\sa load(), setContent(), QWebEnginePage::toHtml(), QWebEnginePage::setContent()
@@ -154,12 +145,12 @@
/*!
\fn void QWebEngineView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
Sets the content of the web view to the specified content \a data. If the \a mimeType argument
- is empty it is currently assumed that the content is HTML but in future versions we may introduce
- auto-detection.
+ is empty, it is currently assumed that the content is HTML but in future versions we may
+ introduce auto-detection.
External objects referenced in the content are located relative to \a baseUrl.
- The \a data is loaded immediately; external objects are loaded asynchronously.
+ The data is loaded immediately; external objects are loaded asynchronously.
\sa load(), setHtml(), QWebEnginePage::toHtml()
*/
@@ -168,7 +159,7 @@
\fn QWebEngineHistory *QWebEngineView::history() const
Returns a pointer to the view's history of navigated web pages.
- It is equivalent to
+ It is equivalent to:
\snippet qtwebengine_qwebengineview_snippet.cpp 0
*/
@@ -184,7 +175,7 @@
/*!
\property QWebEngineView::url
- \brief the url of the web page currently viewed
+ \brief the URL of the web page currently viewed
Setting this property clears the view and loads the URL.
@@ -195,7 +186,7 @@
/*!
\property QWebEngineView::iconUrl
- \brief the url of the icon associated with the web page currently viewed
+ \brief the URL of the icon associated with the web page currently viewed
\sa iconUrlChanged()
*/
@@ -204,7 +195,7 @@
\property QWebEngineView::hasSelection
\brief whether this page contains selected content or not.
- By default, this property is false.
+ By default, this property is \c false.
\sa selectionChanged()
*/
@@ -225,7 +216,7 @@
/*!
\fn void QWebEngineView::triggerPageAction(QWebEnginePage::WebAction action, bool checked)
- Triggers the specified \a action. If it is a checkable action the specified
+ Triggers the specified \a action. If it is a checkable action, the specified
\a checked state is assumed.
The following example triggers the copy action and therefore copies any
@@ -256,8 +247,8 @@
To clear the selection, just pass an empty string.
- The \a resultCallback must take a boolean parameter. It will be called with a value of true if the \a subString
- was found; otherwise the callback value will be false.
+ \a resultCallback must take a boolean parameter. It will be called with a value of \c true
+ if \a subString was found; otherwise the callback value will be \c false.
\sa selectedText(), selectionChanged()
*/
@@ -266,7 +257,7 @@
\fn void QWebEngineView::stop()
Convenience slot that stops loading the document.
- It is equivalent to
+ It is equivalent to:
\snippet qtwebengine_qwebengineview_snippet.cpp 3
@@ -278,7 +269,7 @@
Convenience slot that loads the previous document in the list of documents
built by navigating links. Does nothing if there is no previous document.
- It is equivalent to
+ It is equivalent to:
\snippet qtwebengine_qwebengineview_snippet.cpp 4
@@ -290,7 +281,7 @@
Convenience slot that loads the next document in the list of documents
built by navigating links. Does nothing if there is no next document.
- It is equivalent to
+ It is equivalent to:
\snippet qtwebengine_qwebengineview_snippet.cpp 5
@@ -306,11 +297,11 @@
/*!
\fn QWebEngineView *QWebEngineView::createWindow(QWebEnginePage::WebWindowType type)
- This function is called from the createWindow() method of the associated QWebEnginePage,
- each time the page wants to create a new window of the given \a type. This might
- be the result, for example, of a JavaScript request to open a document in a new window.
+ This function is called from the \l{QWebEnginePage::}{createWindow()} method of the associated
+ QWebEnginePage each time the page wants to create a new window of the given \a type. For
+ example, when a JavaScript request to open a document in a new window is issued.
- \note If the createWindow() method of the associated page is reimplemented, this
+ \note If the \c createWindow() method of the associated page is reimplemented, this
method is not called, unless explicitly done so in the reimplementation.
\sa QWebEnginePage::createWindow()
@@ -351,8 +342,8 @@
/*!
\fn void QWebEngineView::loadFinished(bool ok)
- This signal is emitted when a load of the page is finished.
- \a ok will indicate whether the load was successful or any error occurred.
+ This signal is emitted when a load of the page has finished.
+ \a ok will indicate whether the load was successful or an error occurred.
\sa loadStarted()
*/
@@ -382,9 +373,9 @@
/*!
\fn QWebEngineSettings *QWebEngineView::settings() const
- Returns a pointer to the view/page specific settings object.
+ Returns a pointer to the view or page specific settings object.
- It is equivalent to
+ It is equivalent to:
\snippet qtwebengine_qwebengineview_snippet.cpp 6