QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
gui
qgsrelationeditorwidget.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsrelationeditorwidget.h
3
--------------------------------------
4
Date : 17.5.2013
5
Copyright : (C) 2013 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 QGSRELATIONEDITOR_H
17
#define QGSRELATIONEDITOR_H
18
19
#include <QWidget>
20
#include <QToolButton>
21
#include <QButtonGroup>
22
#include <QGridLayout>
23
24
#include "
qgsattributeeditorcontext.h
"
25
#include "
qgscollapsiblegroupbox.h
"
26
#include "
qgsdualview.h
"
27
#include "
qgsrelation.h
"
28
29
class
QgsFeature
;
30
class
QgsGenericFeatureSelectionManager
;
31
class
QgsVectorLayer
;
32
class
QgsVectorLayerTools
;
33
37
class
GUI_EXPORT
QgsRelationEditorWidget
:
public
QgsCollapsibleGroupBox
38
{
39
Q_OBJECT
40
Q_PROPERTY(
QgsDualView::ViewMode
viewMode READ viewMode WRITE setViewMode )
41
Q_PROPERTY(
bool
showLabel READ showLabel WRITE setShowLabel )
42
43
public:
47
QgsRelationEditorWidget
(
QWidget
* parent =
nullptr
);
48
50
void
setViewMode(
QgsDualView
::ViewMode mode );
51
53
QgsDualView
::ViewMode viewMode() {
return
mViewMode;}
54
55
void
setRelationFeature(
const
QgsRelation
& relation,
const
QgsFeature
& feature );
56
66
void
setRelations(
const
QgsRelation
& relation,
const
QgsRelation
& nmrelation );
67
68
void
setFeature(
const
QgsFeature
& feature );
69
70
void
setEditorContext(
const
QgsAttributeEditorContext
& context );
71
76
QgsIFeatureSelectionManager
* featureSelectionManager();
77
83
bool
showLabel()
const
;
84
90
void
setShowLabel(
bool
showLabel );
91
97
bool
showLinkButton()
const
;
103
void
setShowLinkButton(
bool
showLinkButton );
104
110
bool
showUnlinkButton()
const
;
116
void
setShowUnlinkButton(
bool
showUnlinkButton );
117
118
private
slots:
119
void
setViewMode(
int
mode ) {setViewMode( static_cast<QgsDualView::ViewMode>( mode ) );}
120
void
updateButtons();
121
122
void
addFeature();
123
void
linkFeature();
124
void
deleteFeature();
125
void
unlinkFeature();
126
void
saveEdits();
127
void
toggleEditing(
bool
state );
128
void
onCollapsedStateChanged(
bool
collapsed );
129
130
private
:
131
void
updateUi();
132
133
QgsDualView
* mDualView;
134
QgsDualView::ViewMode
mViewMode;
135
QgsGenericFeatureSelectionManager
* mFeatureSelectionMgr;
136
QgsAttributeEditorContext
mEditorContext;
137
QgsRelation
mRelation;
138
QgsRelation
mNmRelation;
139
QgsFeature
mFeature;
140
141
QToolButton
* mToggleEditingButton;
142
QToolButton
* mSaveEditsButton;
143
QToolButton
* mAddFeatureButton;
144
QToolButton
* mDeleteFeatureButton;
145
QToolButton
* mLinkFeatureButton;
146
QToolButton
* mUnlinkFeatureButton;
147
QToolButton
* mFormViewButton;
148
QToolButton
* mTableViewButton;
149
QGridLayout
* mRelationLayout;
150
QButtonGroup
* mViewModeButtonGroup;
151
152
bool
mShowLabel;
153
bool
mVisible;
154
};
155
156
#endif // QGSRELATIONEDITOR_H
QgsVectorLayerTools
Methods in this class are used to handle basic operations on vector layers.
Definition:
qgsvectorlayertools.h:33
qgsattributeeditorcontext.h
qgsdualview.h
QWidget
QgsCollapsibleGroupBox
A groupbox that collapses/expands when toggled and can save its collapsed and checked states...
Definition:
qgscollapsiblegroupbox.h:183
QgsAttributeEditorContext
This class contains context information for attribute editor widgets.
Definition:
qgsattributeeditorcontext.h:33
QgsDualView::ViewMode
ViewMode
The view modes, in which this widget can present information.
Definition:
qgsdualview.h:55
QGridLayout
QgsFeature
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition:
qgsfeature.h:187
QgsRelationEditorWidget
Definition:
qgsrelationeditorwidget.h:37
qgsrelation.h
QButtonGroup
QToolButton
QgsGenericFeatureSelectionManager
This selection manager synchronizes a local set of selected features with an attribute table...
Definition:
qgsgenericfeatureselectionmanager.h:28
QgsRelation
Definition:
qgsrelation.h:31
QgsIFeatureSelectionManager
Is an interface class to abstract feature selection handling.
Definition:
qgsifeatureselectionmanager.h:29
qgscollapsiblegroupbox.h
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:408
QgsDualView
This widget is used to show the attributes of a set of features of a QgsVectorLayer.
Definition:
qgsdualview.h:43
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13