QGIS API Documentation  2.99.0-Master (314842d)
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_gui.h"
21 
23 
29 class GUI_EXPORT QgsRelationWidgetWrapper : public QgsWidgetWrapper
30 {
31  Q_OBJECT
32 
33  public:
34  explicit QgsRelationWidgetWrapper( QgsVectorLayer *vl, const QgsRelation &relation, QWidget *editor = nullptr, QWidget *parent = nullptr );
35 
42  bool showLabel() const;
43 
50  void setShowLabel( bool showLabel );
51 
57  bool showLinkButton() const;
58 
64  void setShowLinkButton( bool showLinkButton );
65 
71  bool showUnlinkButton() const;
72 
78  void setShowUnlinkButton( bool showUnlinkButton );
79 
80  protected:
81  QWidget *createWidget( QWidget *parent ) override;
82  void initWidget( QWidget *editor ) override;
83  bool valid() const override;
84 
85  public slots:
86  void setFeature( const QgsFeature &feature ) override;
87 
92  void setVisible( bool visible );
93 
94  private:
95  QgsRelation mRelation;
96  QgsRelationEditorWidget *mWidget = nullptr;
97 };
98 
99 #endif // QGSRELATIONWIDGETWRAPPER_H
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:136
virtual void setFeature(const QgsFeature &feature)=0
Is called, when the value of the widget needs to be changed.
virtual bool valid() const =0
Return true if the widget has been properly initialized.
virtual QWidget * createWidget(QWidget *parent)=0
This method should create a new widget with the provided parent.
virtual void initWidget(QWidget *editor)
This method should initialize the editor widget with runtime data.
Represents a vector layer which manages a vector based data sets.
Manages an editor widget Widget and wrapper share the same parent.