QGIS API Documentation
3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
src
gui
editorwidgets
qgstextwidgetwrapper.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgstextwidgetwrapper.h
3
4
---------------------
5
begin : 28.12.2022
6
copyright : (C) 2022 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 QGSTEXTWIDGETWRAPPER_H
17
#define QGSTEXTWIDGETWRAPPER_H
18
19
#include "
qgswidgetwrapper.h
"
20
#include "qgis_gui.h"
21
#include <QLabel>
22
28
class
GUI_EXPORT
QgsTextWidgetWrapper
:
public
QgsWidgetWrapper
29
{
30
Q_OBJECT
31
32
public
:
40
QgsTextWidgetWrapper
(
QgsVectorLayer
*layer, QWidget *editor, QWidget *parent );
41
42
bool
valid
()
const override
;
43
44
QWidget *
createWidget
( QWidget *parent )
override
;
45
46
void
initWidget
( QWidget *editor )
override
;
47
49
void
reinitWidget();
50
52
void
setText(
const
QString &text );
53
57
bool
needsGeometry()
const
;
58
59
private
slots:
60
62
void
updateTextContext();
63
64
public
slots:
65
void
setFeature
(
const
QgsFeature
&feature )
override
;
66
67
private
:
68
QString mText;
69
QLabel *mWidget =
nullptr
;
70
QgsFeature
mFeature;
71
QgsFeature
mFormFeature;
72
bool
mRequiresFormScope =
false
;
73
QgsExpressionContext
mTextContext;
74
bool
mNeedsGeometry =
false
;
75
76
friend
class
TestQgsTextWidgetWrapper;
77
};
78
79
80
#endif
// QGSTEXTWIDGETWRAPPER_H
QgsExpressionContext
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Definition
qgsexpressioncontext.h:471
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition
qgsfeature.h:58
QgsTextWidgetWrapper
Wraps a label widget to display text.
Definition
qgstextwidgetwrapper.h:29
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition
qgsvectorlayer.h:401
QgsWidgetWrapper
Manages an editor widget Widget and wrapper share the same parent.
Definition
qgswidgetwrapper.h:53
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:107
QgsWidgetWrapper::createWidget
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
qgswidgetwrapper.h
Generated on Sun Dec 15 2024 01:32:01 for QGIS API Documentation by
1.9.8