QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgswebenginepage.h
Go to the documentation of this file.
1/***************************************************************************
2 qgswebenginepage.h
3 -------------------
4 begin : December 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSWEBENGINEPAGE_H
19#define QGSWEBENGINEPAGE_H
20
21#include "qgis_sip.h"
22#include "qgis_core.h"
23#include <QObject>
24#include <QUrl>
25#include <QPageLayout>
26#include <QSize>
27#include <memory>
28
29SIP_IF_MODULE( HAVE_WEBENGINE_SIP )
30
31class QWebEnginePage;
32class QPainter;
33
42class CORE_EXPORT QgsWebEnginePage : public QObject
43{
44 Q_OBJECT
45
46 public:
47
51 QgsWebEnginePage( QObject *parent SIP_TRANSFERTHIS = nullptr );
53
59 QWebEnginePage *page() SIP_SKIP;
60
72 bool setContent( const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl(), bool blocking = false );
73
87 bool setHtml( const QString &html, const QUrl &baseUrl = QUrl(), bool blocking = false );
88
100 bool setUrl( const QUrl &url, bool blocking = false );
101
107 QSize documentSize() const;
108
121 bool render( QPainter *painter, const QRectF &painterRect ) SIP_THROW( QgsNotSupportedException );
122
123 signals:
124
128 void loadStarted();
129
136 void loadProgress( int progress );
137
145 void loadFinished( bool ok );
146
147 private:
148
149 void handlePostBlockingLoadOperations();
150
151 std::unique_ptr< QWebEnginePage > mPage;
152 mutable QSize mCachedSize;
153};
154
155#endif // QGSWEBENGINEPAGE_H
Custom exception class which is raised when an operation is not supported.
A wrapper around the QWebEnginePage class, adding extra functionality.
~QgsWebEnginePage() override
#define SIP_IF_MODULE(condition)
Definition qgis_sip.h:28
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_THROW(name,...)
Definition qgis_sip.h:203