QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsrelationwidgetwrapper.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrelationwidgetwrapper.h
3 --------------------------------------
4 Date : 14.5.2014
5 Copyright : (C) 2014 Matthias Kuhn
6 Email : matthias at opengis dot ch
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSRELATIONWIDGETWRAPPER_H
17#define QGSRELATIONWIDGETWRAPPER_H
18
19#include "qgswidgetwrapper.h"
20#include "qgis_sip.h"
21#include "qgis_gui.h"
23
24
26
33{
34 Q_OBJECT
35
36 public:
40 const QgsRelation &relation,
41 QWidget *editor SIP_CONSTRAINED = nullptr,
42 QWidget *parent SIP_TRANSFERTHIS SIP_CONSTRAINED = nullptr
43 );
44
47 const QString &relationEditorName,
49 const QgsRelation &relation,
50 QWidget *editor = nullptr,
51 QWidget *parent SIP_TRANSFERTHIS = nullptr
52 );
53
60 Q_DECL_DEPRECATED bool showLabel() const SIP_DEPRECATED;
61
68 Q_DECL_DEPRECATED void setShowLabel( bool showLabel ) SIP_DEPRECATED;
69
74 Q_DECL_DEPRECATED bool showLinkButton() const SIP_DEPRECATED;
75
80 Q_DECL_DEPRECATED void setShowLinkButton( bool showLinkButton ) SIP_DEPRECATED;
81
86 Q_DECL_DEPRECATED bool showUnlinkButton() const SIP_DEPRECATED;
87
92 Q_DECL_DEPRECATED void setShowUnlinkButton( bool showUnlinkButton ) SIP_DEPRECATED;
93
99 Q_DECL_DEPRECATED void setShowSaveChildEditsButton( bool showChildEdits ) SIP_DEPRECATED;
100
106 Q_DECL_DEPRECATED bool showSaveChildEditsButton() const SIP_DEPRECATED;
107
113 Q_DECL_DEPRECATED void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons ) SIP_DEPRECATED;
114
120 Q_DECL_DEPRECATED QgsAttributeEditorRelation::Buttons visibleButtons() const SIP_DEPRECATED;
121
122
129 void setWidgetConfig( const QVariantMap &config );
130
135 QVariantMap widgetConfig() const;
136
141 bool forceSuppressFormPopup() const;
142
150 void setForceSuppressFormPopup( bool forceSuppressFormPopup );
151
156 QVariant nmRelationId() const;
157
163 void setNmRelationId( const QVariant &nmRelationId = QVariant() );
164
170 Q_DECL_DEPRECATED QString label() const SIP_DEPRECATED;
171
178 Q_DECL_DEPRECATED void setLabel( const QString &label = QString() ) SIP_DEPRECATED;
179
184 QgsRelation relation() const;
185
197 void widgetValueChanged( const QString &attribute, const QVariant &newValue, bool attributeChanged );
198
199
200 protected:
201 QWidget *createWidget( QWidget *parent ) override;
202 void initWidget( QWidget *editor ) override;
203 bool valid() const override;
204
205 signals:
206
215
216 public slots:
217 void setFeature( const QgsFeature &feature ) override;
218
224 void setMultiEditFeatureIds( const QgsFeatureIds &fids );
225
230 void setVisible( bool visible );
231
232 private:
233 void aboutToSave() override;
234 QgsRelation mRelation;
235 QgsRelation mNmRelation;
236 QString mRelationEditorId;
237 QgsAbstractRelationEditorWidget *mWidget = nullptr;
238};
239
240#endif // QGSRELATIONWIDGETWRAPPER_H
Base class to build new relation widgets.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
void relatedFeaturesChanged()
Emit this signal, whenever the related features changed.
Represents a relationship between two vector layers.
Definition qgsrelation.h:44
Represents a vector layer which manages a vector based data sets.
Manages an editor widget Widget and wrapper share the same parent.
virtual void setFeature(const QgsFeature &feature)=0
Is called when the value of the widget needs to be changed.
virtual bool valid() const =0
Returns true if the widget has been properly initialized.
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
#define SIP_DEPRECATED
Definition qgis_sip.h:106
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_CONSTRAINED
Definition qgis_sip.h:111
QSet< QgsFeatureId > QgsFeatureIds