QGIS API Documentation
4.3.0-Master (a080b0d5f12)
Toggle main menu visibility
Loading...
Searching...
No Matches
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 <memory>
22
23
#include "qgis_core.h"
24
#include "
qgis_sip.h
"
25
26
#include <QObject>
27
#include <QPageLayout>
28
#include <QSize>
29
#include <QUrl>
30
31
SIP_IF_MODULE
( HAVE_WEBENGINE_SIP )
32
33
class
QWebEnginePage;
34
class
QPainter;
35
44
class
CORE_EXPORT
QgsWebEnginePage
:
public
QObject
45
{
46
Q_OBJECT
47
48
public
:
52
QgsWebEnginePage
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
53
~QgsWebEnginePage
()
override
;
54
60
QWebEnginePage *
page
()
SIP_SKIP
;
61
73
bool
setContent
( const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl(),
bool
blocking = false );
74
88
bool
setHtml
( const QString &html, const QUrl &baseUrl = QUrl(),
bool
blocking = false );
89
101
bool
setUrl
( const QUrl &url,
bool
blocking = false );
102
108
QSize
documentSize
() const;
109
122
bool
render
( QPainter *painter, const QRectF &painterRect )
SIP_THROW
(
QgsNotSupportedException
);
123
124
signals:
125
129
void
loadStarted
();
130
137
void
loadProgress
(
int
progress );
138
146
void
loadFinished
(
bool
ok );
147
148
private:
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:111
QgsWebEnginePage::setContent
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.
Definition
qgswebenginepage.cpp:51
QgsWebEnginePage::loadStarted
void loadStarted()
This signal is emitted when the page starts loading content.
QgsWebEnginePage::setHtml
bool setHtml(const QString &html, const QUrl &baseUrl=QUrl(), bool blocking=false)
Sets the content of this page to html.
Definition
qgswebenginepage.cpp:80
QgsWebEnginePage::setUrl
bool setUrl(const QUrl &url, bool blocking=false)
Sets the url of the web page to be displayed.
Definition
qgswebenginepage.cpp:110
QgsWebEnginePage::loadFinished
void loadFinished(bool ok)
This signal is emitted when the page finishes loading content.
QgsWebEnginePage::QgsWebEnginePage
QgsWebEnginePage(QObject *parent=nullptr)
Constructor for QgsWebEnginePage, with the specified parent widget.
Definition
qgswebenginepage.cpp:34
QgsWebEnginePage::render
bool render(QPainter *painter, const QRectF &painterRect)
Renders the web page contents to a painter.
Definition
qgswebenginepage.cpp:230
QgsWebEnginePage::loadProgress
void loadProgress(int progress)
This signal is emitted when the global progress status changes.
QgsWebEnginePage::~QgsWebEnginePage
~QgsWebEnginePage() override
QgsWebEnginePage::page
QWebEnginePage * page()
Returns a reference to the QWebEnginePage.
Definition
qgswebenginepage.cpp:46
QgsWebEnginePage::documentSize
QSize documentSize() const
Returns the size of the page document, in pixels.
Definition
qgswebenginepage.cpp:140
qgis_sip.h
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition
qgis_sip.h:27
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
SIP_SKIP
#define SIP_SKIP
Definition
qgis_sip.h:138
SIP_THROW
#define SIP_THROW(name,...)
Definition
qgis_sip.h:215
Generated on
for QGIS API Documentation by
1.17.0