QGIS API Documentation
3.37.0-Master (fdefdf9c27f)
src
core
web
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
29
SIP_IF_MODULE
( HAVE_WEBENGINE_SIP )
30
31
class
QWebEnginePage;
32
class
QPainter;
33
42
class
CORE_EXPORT
QgsWebEnginePage
:
public
QObject
43
{
44
Q_OBJECT
45
46
public
:
47
51
QgsWebEnginePage
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
52
~QgsWebEnginePage
()
override
;
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
QgsNotSupportedException
Custom exception class which is raised when an operation is not supported.
Definition:
qgsexception.h:118
QgsWebEnginePage
A wrapper around the QWebEnginePage class, adding extra functionality.
Definition:
qgswebenginepage.h:43
QgsWebEnginePage::~QgsWebEnginePage
~QgsWebEnginePage() override
geos::unique_ptr
std::unique_ptr< GEOSGeometry, GeosDeleter > unique_ptr
Scoped GEOS pointer.
Definition:
qgsgeos.h:73
qgis_sip.h
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition:
qgis_sip.h:28
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition:
qgis_sip.h:53
SIP_SKIP
#define SIP_SKIP
Definition:
qgis_sip.h:126
SIP_THROW
#define SIP_THROW(name,...)
Definition:
qgis_sip.h:203
Generated by
1.9.4