QGIS API Documentation 3.41.0-Master (45a0abf3bec)
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:
37
41 const QgsRelation &relation,
42 QWidget *editor SIP_CONSTRAINED = nullptr,
43 QWidget *parent SIP_TRANSFERTHIS SIP_CONSTRAINED = nullptr
44 );
45
48 const QString &relationEditorName,
50 const QgsRelation &relation,
51 QWidget *editor = nullptr,
52 QWidget *parent SIP_TRANSFERTHIS = nullptr
53 );
54
61 Q_DECL_DEPRECATED bool showLabel() const SIP_DEPRECATED;
62
69 Q_DECL_DEPRECATED void setShowLabel( bool showLabel ) SIP_DEPRECATED;
70
75 Q_DECL_DEPRECATED bool showLinkButton() const SIP_DEPRECATED;
76
81 Q_DECL_DEPRECATED void setShowLinkButton( bool showLinkButton ) SIP_DEPRECATED;
82
87 Q_DECL_DEPRECATED bool showUnlinkButton() const SIP_DEPRECATED;
88
93 Q_DECL_DEPRECATED void setShowUnlinkButton( bool showUnlinkButton ) SIP_DEPRECATED;
94
100 Q_DECL_DEPRECATED void setShowSaveChildEditsButton( bool showChildEdits ) SIP_DEPRECATED;
101
107 Q_DECL_DEPRECATED bool showSaveChildEditsButton() const SIP_DEPRECATED;
108
114 Q_DECL_DEPRECATED void setVisibleButtons( const QgsAttributeEditorRelation::Buttons &buttons ) SIP_DEPRECATED;
115
121 Q_DECL_DEPRECATED QgsAttributeEditorRelation::Buttons visibleButtons() const SIP_DEPRECATED;
122
123
130 void setWidgetConfig( const QVariantMap &config );
131
136 QVariantMap widgetConfig() const;
137
142 bool forceSuppressFormPopup() const;
143
151 void setForceSuppressFormPopup( bool forceSuppressFormPopup );
152
157 QVariant nmRelationId() const;
158
164 void setNmRelationId( const QVariant &nmRelationId = QVariant() );
165
171 Q_DECL_DEPRECATED QString label() const SIP_DEPRECATED;
172
179 Q_DECL_DEPRECATED void setLabel( const QString &label = QString() ) SIP_DEPRECATED;
180
185 QgsRelation relation() const;
186
198 void widgetValueChanged( const QString &attribute, const QVariant &newValue, bool attributeChanged );
199
200
201 protected:
202 QWidget *createWidget( QWidget *parent ) override;
203 void initWidget( QWidget *editor ) override;
204 bool valid() const override;
205
206 signals:
207
216
217 public slots:
218 void setFeature( const QgsFeature &feature ) override;
219
225 void setMultiEditFeatureIds( const QgsFeatureIds &fids );
226
231 void setVisible( bool visible );
232
233 private:
234 void aboutToSave() override;
235 QgsRelation mRelation;
236 QgsRelation mNmRelation;
237 QString mRelationEditorId;
238 QgsAbstractRelationEditorWidget *mWidget = nullptr;
239};
240
241#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