QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
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 "qgis_gui.h"
20
#include "
qgis_sip.h
"
21
#include "
qgswebview.h
"
22
#include "
qgswidgetwrapper.h
"
23
29
class
GUI_EXPORT
QgsHtmlWidgetWrapper
:
public
QgsWidgetWrapper
30
{
31
Q_OBJECT
32
33
public
:
41
QgsHtmlWidgetWrapper
(
QgsVectorLayer
*
layer
, QWidget *editor, QWidget *parent );
42
43
bool
valid
()
const override
;
44
45
QWidget *
createWidget
( QWidget *parent )
override
;
46
47
void
initWidget
( QWidget *editor )
override
;
48
50
void
reinitWidget
();
51
53
void
setHtmlCode
(
const
QString &htmlCode );
54
59
bool
needsGeometry
()
const
;
60
61
public
slots:
62
void
setFeature
(
const
QgsFeature
&feature )
override
;
63
64
private
slots:
66
void
updateHtmlCode();
67
68
private
:
69
QString mHtmlCode;
70
QgsWebView
*mWidget =
nullptr
;
71
QgsFeature
mFeature;
72
bool
mNeedsGeometry =
false
;
73
QgsFeature
mFormFeature;
74
bool
mRequiresFormScope =
false
;
75
76
friend
class
TestQgsHtmlWidgetWrapper
;
77
};
78
79
#endif
// QGSHTMLWIDGETWRAPPER_H
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:60
QgsHtmlWidgetWrapper::reinitWidget
void reinitWidget()
Clears the content and makes new initialization.
Definition
qgshtmlwidgetwrapper.cpp:75
QgsHtmlWidgetWrapper::QgsHtmlWidgetWrapper
QgsHtmlWidgetWrapper(QgsVectorLayer *layer, QWidget *editor, QWidget *parent)
Create a html widget wrapper.
Definition
qgshtmlwidgetwrapper.cpp:31
QgsHtmlWidgetWrapper::setHtmlCode
void setHtmlCode(const QString &htmlCode)
Sets the HTML code to htmlCode.
Definition
qgshtmlwidgetwrapper.cpp:83
QgsHtmlWidgetWrapper::needsGeometry
bool needsGeometry() const
Returns true if the widget needs feature geometry.
Definition
qgshtmlwidgetwrapper.cpp:170
QgsHtmlWidgetWrapper::TestQgsHtmlWidgetWrapper
friend class TestQgsHtmlWidgetWrapper
Definition
qgshtmlwidgetwrapper.h:76
QgsVectorLayer
Represents a vector layer which manages a vector based dataset.
Definition
qgsvectorlayer.h:414
QgsWebView
A collection of stubs to mimic the API of QWebView on systems where the real library is not available...
Definition
qgswebview.h:39
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.
QgsWidgetWrapper::initWidget
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
Definition
qgswidgetwrapper.cpp:109
QgsWidgetWrapper::QgsWidgetWrapper
QgsWidgetWrapper(QgsVectorLayer *vl, QWidget *editor=nullptr, QWidget *parent=nullptr)
Create a new widget wrapper.
Definition
qgswidgetwrapper.cpp:42
QgsWidgetWrapper::layer
QgsVectorLayer * layer() const
Returns the vector layer associated with the widget.
Definition
qgswidgetwrapper.cpp:94
QgsWidgetWrapper::createWidget
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
qgis_sip.h
qgswebview.h
qgswidgetwrapper.h
Generated on
for QGIS API Documentation by
1.17.0