WebView QML Type
A component for displaying web content. More...
|Import Statement:||import QtWebView 1.14|
- canGoBack : bool
- canGoForward : bool
- httpUserAgent : url
- loadProgress : int
- loading : bool
- title : string
- url : url
- void goBack()
- void goForward()
- void loadHtml(html, url baseUrl)
- void reload()
- void stop()
WebView is a component for displaying web content which is implemented using native APIs on the platforms where this is available, thus it does not necessarily require including a full web browser stack as part of the application.
Note: Due to platform limitations overlapping the WebView and other QML components is not supported.
[read-only] canGoBack : bool
true if it's currently possible to navigate back in the web history.
[read-only] canGoForward : bool
true if it's currently possible to navigate forward in the web history.
httpUserAgent : url
The user agent in use.
Note: on WinRT, this property affects all WebViews of the application.
This property was introduced in QtWebView 1.14.
[read-only] loadProgress : int
The current load progress of the web content, represented as an integer between 0 and 100.
[read-only] loading : bool
[read-only] title : string
The title of the currently loaded web page.
url : url
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 loadRequest parameter holds the url and status of the request, as well as an errorString containing an error message for a failed request.
See also WebViewLoadRequest.
Navigates back in the web history.
Navigates forward in the web history.
void loadHtml(html, url baseUrl)
Loads the specified html content to the web view.
This method offers a lower-level alternative to the 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 baseUrl. For example, if html is retrieved from
http://www.example.com/documents/overview.html, which is the base URL, then an image referenced with the relative url,
diagram.png, should be at
Note: The WebView does not support loading content through the Qt Resource system.
See also url.
Reloads the current url.
Stops loading the current url.
© 2020 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.