QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
A wrapper around the QWebEnginePage class, adding extra functionality. More...
#include <qgswebenginepage.h>
Signals | |
void | loadFinished (bool ok) |
This signal is emitted when the page finishes loading content. | |
void | loadProgress (int progress) |
This signal is emitted when the global progress status changes. | |
void | loadStarted () |
This signal is emitted when the page starts loading content. | |
Public Member Functions | |
QgsWebEnginePage (QObject *parent=nullptr) | |
Constructor for QgsWebEnginePage, with the specified parent widget. | |
~QgsWebEnginePage () override | |
QSize | documentSize () const |
Returns the size of the page document, in pixels. | |
QWebEnginePage * | page () |
Returns a reference to the QWebEnginePage. | |
bool | render (QPainter *painter, const QRectF &painterRect) |
Renders the web page contents to a painter. | |
bool | setContent (const QByteArray &data, const QString &mimeType=QString(), const QUrl &baseUrl=QUrl(), bool blocking=false) |
Sets the content of the web page to data. | |
bool | setHtml (const QString &html, const QUrl &baseUrl=QUrl(), bool blocking=false) |
Sets the content of this page to html. | |
bool | setUrl (const QUrl &url, bool blocking=false) |
Sets the url of the web page to be displayed. | |
A wrapper around the QWebEnginePage class, adding extra functionality.
Definition at line 42 of file qgswebenginepage.h.
QgsWebEnginePage::QgsWebEnginePage | ( | QObject * | parent = nullptr | ) |
Constructor for QgsWebEnginePage, with the specified parent widget.
Definition at line 32 of file qgswebenginepage.cpp.
|
overridedefault |
QSize QgsWebEnginePage::documentSize | ( | ) | const |
Returns the size of the page document, in pixels.
Definition at line 141 of file qgswebenginepage.cpp.
|
signal |
This signal is emitted when the page finishes loading content.
This signal is independent of script execution or page rendering.
ok will indicate whether the load was successful or any error occurred.
|
signal |
This signal is emitted when the global progress status changes.
The current value is provided by progress and scales from 0 to 100. It accumulates changes from all the child frames.
|
signal |
This signal is emitted when the page starts loading content.
QWebEnginePage * QgsWebEnginePage::page | ( | ) |
Returns a reference to the QWebEnginePage.
Definition at line 44 of file qgswebenginepage.cpp.
bool QgsWebEnginePage::render | ( | QPainter * | painter, |
const QRectF & | painterRect | ||
) |
Renders the web page contents to a painter.
Content will be rendered as vector objects.
The painterRect argument specifies the target rectangle for the page in painter coordinates.
true
if rendering was successfulQgsNotSupportedException | on QGIS builds without PDF4Qt library support. |
Definition at line 234 of file qgswebenginepage.cpp.
bool QgsWebEnginePage::setContent | ( | const QByteArray & | data, |
const QString & | mimeType = QString() , |
||
const QUrl & | baseUrl = QUrl() , |
||
bool | blocking = false |
||
) |
Sets the content of the web page to data.
If the mimeType argument is empty, it is assumed that the content is text/plain,charset=US-ASCII
The baseUrl is optional and used to resolve relative URLs in the document, such as referenced images or stylesheets.
If blocking is true
then the call will block while the HTML is loaded. Otherwise the html is loaded immediately; external objects are loaded asynchronously.
true
involves running the event loop on the current thread. Take care when calling from the main thread as incorrect use will result in crashes.true
if loading was successful Definition at line 49 of file qgswebenginepage.cpp.
bool QgsWebEnginePage::setHtml | ( | const QString & | html, |
const QUrl & | baseUrl = QUrl() , |
||
bool | blocking = false |
||
) |
Sets the content of this page to html.
The baseUrl is optional and used to resolve relative URLs in the document, such as referenced images or stylesheets.
If blocking is true
then the call will block while the HTML is loaded. Otherwise the html is loaded immediately; external objects are loaded asynchronously.
true
involves running the event loop on the current thread. Take care when calling from the main thread as incorrect use will result in crashes.true
if loading was successful Definition at line 79 of file qgswebenginepage.cpp.
bool QgsWebEnginePage::setUrl | ( | const QUrl & | url, |
bool | blocking = false |
||
) |
Sets the url of the web page to be displayed.
Setting this property clears the page and loads the URL.
If blocking is true
then the call will block while the HTML is loaded. Otherwise the html is loaded immediately; external objects are loaded asynchronously.
true
involves running the event loop on the current thread. Take care when calling from the main thread as incorrect use will result in crashes.true
if loading was successful Definition at line 110 of file qgswebenginepage.cpp.