QGIS API Documentation
3.8.0-Zanzibar (11aff65)
src
gui
editorwidgets
qgshtmlwidgetwrapper.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgshtmlwidgetwrapper.h
3
4
---------------------
5
begin : 23.03.2019
6
copyright : (C) 2019 by Alessandro Pasotti
7
email : elpaso at itopen dot it
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSHTMLWIDGETWRAPPER_H
17
#define QGSHTMLWIDGETWRAPPER_H
18
19
#include "
qgswidgetwrapper.h
"
20
#include "
qgswebview.h
"
21
#include "
qgis_sip.h
"
22
#include "qgis_gui.h"
23
29
class
GUI_EXPORT
QgsHtmlWidgetWrapper
:
public
QgsWidgetWrapper
30
{
31
Q_OBJECT
32
33
public
:
34
42
QgsHtmlWidgetWrapper
(
QgsVectorLayer
*layer, QWidget *editor, QWidget *parent );
43
44
bool
valid
()
const override
;
45
46
QWidget *
createWidget
( QWidget *parent )
override
;
47
48
void
initWidget
( QWidget *editor )
override
;
49
51
void
reinitWidget();
52
54
void
setHtmlCode(
const
QString &htmlCode );
55
56
public
slots:
57
void
setFeature
(
const
QgsFeature
&feature )
override
;
58
59
private
slots:
61
void
setHtmlContext( );
62
63
private
:
64
QString mHtmlCode;
65
QgsWebView
*mWidget =
nullptr
;
66
QgsFeature
mFeature;
67
};
68
69
70
#ifndef SIP_RUN
71
78
class
HtmlExpression :
public
QObject
79
{
80
Q_OBJECT
81
82
public
:
84
void
setExpressionContext(
const
QgsExpressionContext
&context );
85
86
public
:
87
89
Q_INVOKABLE QString evaluate(
const
QString &expression )
const
;
90
91
private
:
92
QgsExpressionContext
mExpressionContext;
93
};
95
#endif //SIP_RUN
96
97
#endif // QGSHTMLWIDGETWRAPPER_H
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition:
qgsfeature.h:55
QgsWidgetWrapper::setFeature
virtual void setFeature(const QgsFeature &feature)=0
Is called, when the value of the widget needs to be changed.
QgsWidgetWrapper::valid
virtual bool valid() const =0
Returns true if the widget has been properly initialized.
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition:
qgsexpressioncontext.h:371
qgis_sip.h
QgsWidgetWrapper::createWidget
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
QgsWidgetWrapper::initWidget
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
Definition:
qgswidgetwrapper.cpp:106
QgsHtmlWidgetWrapper
Wraps a QQuickWidget to display HTML code.
Definition:
qgshtmlwidgetwrapper.h:29
QgsWebView
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition:
qgswebview.h:65
qgswidgetwrapper.h
qgswebview.h
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:362
QgsWidgetWrapper
Manages an editor widget Widget and wrapper share the same parent.
Definition:
qgswidgetwrapper.h:52
Generated on Sat Jun 22 2019 09:24:07 for QGIS API Documentation by
1.8.13