16 #ifndef QGSRELATIONEDITORWIDGET_H
17 #define QGSRELATIONEDITORWIDGET_H
20 #include <QToolButton>
21 #include <QButtonGroup>
22 #include <QGridLayout>
25 #include "ui_qgsrelationeditorconfigwidgetbase.h"
93 Q_PROPERTY( Buttons visibleButtons READ visibleButtons WRITE setVisibleButtons )
104 SaveChildEdits = 1 << 3,
105 AddChildFeature = 1 << 4,
106 DuplicateChildFeature = 1 << 5,
107 DeleteChildFeature = 1 << 6,
108 ZoomToChildFeature = 1 << 7,
109 AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature
112 Q_DECLARE_FLAGS( Buttons, Button )
144 void setVisibleButtons(
const Buttons &buttons );
149 Buttons visibleButtons()
const;
161 void duplicateSelectedFeatures();
166 void unlinkSelectedFeatures();
171 void deleteSelectedFeatures();
176 void zoomToSelectedFeatures();
181 QVariantMap config() const override;
186 void setConfig( const QVariantMap &config ) override;
191 void setTitle( const QString &title ) override;
194 void parentFormValueChanged( const QString &attribute, const QVariant &newValue ) override;
197 virtual
void updateUi() override;
198 void beforeSetRelationFeature( const
QgsRelation &newRelation, const
QgsFeature &newFeature ) override;
199 void afterSetRelationFeature() override;
201 void afterSetRelations() override;
205 void updateButtons();
207 void addFeatureGeometry();
209 void onCollapsedStateChanged(
bool collapsed );
211 void mapToolDeactivated();
212 void onKeyPressed( QKeyEvent *e );
213 void onDigitizingCompleted(
const QgsFeature &feature );
222 QPointer<QgsMessageBarItem> mMessageBarItem;
225 QToolButton *mToggleEditingButton =
nullptr;
226 QToolButton *mSaveEditsButton =
nullptr;
227 QToolButton *mAddFeatureButton =
nullptr;
228 QToolButton *mDuplicateFeatureButton =
nullptr;
229 QToolButton *mDeleteFeatureButton =
nullptr;
230 QToolButton *mLinkFeatureButton =
nullptr;
231 QToolButton *mUnlinkFeatureButton =
nullptr;
232 QToolButton *mZoomToFeatureButton =
nullptr;
233 QToolButton *mFormViewButton =
nullptr;
234 QToolButton *mTableViewButton =
nullptr;
235 QToolButton *mAddFeatureGeometryButton =
nullptr;
236 QGridLayout *mRelationLayout =
nullptr;
238 QButtonGroup *mViewModeButtonGroup =
nullptr;
241 Buttons mButtonsVisibility = Button::AllButtons;
242 bool mVisible =
true;
278 void setConfig(
const QVariantMap &config );
297 QString type()
const override;
299 QString name()
const override;
This class contains context information for attribute editor widgets.
A groupbox that collapses/expands when toggled and can save its collapsed and checked states.
This widget is used to show the attributes of a set of features of a QgsVectorLayer.
ViewMode
The view modes, in which this widget can present information.
@ AttributeEditor
Show a list of the features, where one can be chosen and the according attribute dialog will be prese...
This class wraps a request for features to a vector layer (or directly its vector data provider).
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Is an interface class to abstract feature selection handling.
int selectedFeatureCount() override
Returns the number of features that are selected in this layer.
const QgsFeatureIds & selectedFeatureIds() const override
Returns reference to identifiers of selected features.
Represents a vector layer which manages a vector based data sets.
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features