18#ifndef QGSWEBENGINEPAGE_H
19#define QGSWEBENGINEPAGE_H
76 bool setContent( const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl(),
bool blocking = false );
91 bool setHtml( const QString &html, const QUrl &baseUrl = QUrl(),
bool blocking = false );
104 bool setUrl( const QUrl &url,
bool blocking = false );
194 const QRectF &painterRect,
226 const QRectF &painterRect,
258 void handlePostBlockingLoadOperations();
260 static QString htmlToPdfExecutable();
262 static QString htmlToPdfReturnCodeToString(
int code );
264 static
bool renderBlockingInternal( QPainter *painter,
QgsPdfRenderer &renderer, QString &errorMessage, const QRectF &painterRect, QSizeF &renderedSize );
266 std::unique_ptr< QWebEnginePage > mPage;
267 mutable QSize mCachedSize;
Base class for feedback objects to be used for cancellation of something running in a worker thread.
Encapsulates settings for rendering HTML content.
Custom exception class which is raised when an operation is not supported.
Utility class for rendering PDF documents.
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.
static bool renderBlocking(const QString &html, QPainter *painter, const QRectF &painterRect, QString &errorMessage, QSizeF &renderedSize, const QgsHtmlRenderSettings &settings=QgsHtmlRenderSettings(), QgsFeedback *feedback=nullptr)
Renders HTML content to a painter asynchronously.
void loadStarted()
This signal is emitted when the page starts loading content.
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.
void loadFinished(bool ok)
This signal is emitted when the page finishes loading content.
QgsWebEnginePage(QObject *parent=nullptr)
Constructor for QgsWebEnginePage, with the specified parent widget.
bool render(QPainter *painter, const QRectF &painterRect)
Renders the web page contents to a painter.
void loadProgress(int progress)
This signal is emitted when the global progress status changes.
~QgsWebEnginePage() override
QWebEnginePage * page()
Returns a reference to the QWebEnginePage.
QSize documentSize() const
Returns the size of the page document, in pixels.
static bool printToPdfBlocking(const QString &html, const QString &pdfFileName, QString &errorMessage, int width, const QgsHtmlRenderSettings &settings=QgsHtmlRenderSettings(), QgsFeedback *feedback=nullptr)
Renders HTML content to a PDF file asynchronously.
#define SIP_IF_MODULE(condition)
#define SIP_THROW(name,...)