16#ifndef QGSRELATIONEDITORWIDGET_H
17#define QGSRELATIONEDITORWIDGET_H
21#include <QButtonGroup>
25#include "ui_qgsrelationeditorconfigwidgetbase.h"
94 Q_PROPERTY( Buttons visibleButtons READ visibleButtons WRITE setVisibleButtons )
107 SaveChildEdits = 1 << 3,
108 AddChildFeature = 1 << 4,
109 DuplicateChildFeature = 1 << 5,
110 DeleteChildFeature = 1 << 6,
111 ZoomToChildFeature = 1 << 7,
112 AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature
115 Q_DECLARE_FLAGS( Buttons, Button )
147 void setVisibleButtons(
const Buttons &buttons );
152 Buttons visibleButtons()
const;
164 void duplicateSelectedFeatures();
169 void unlinkSelectedFeatures();
174 void deleteSelectedFeatures();
179 void zoomToSelectedFeatures();
184 QVariantMap config() const override;
189 void setConfig( const QVariantMap &config ) override;
192 void parentFormValueChanged( const QString &attribute, const QVariant &newValue ) override;
195 virtual
void updateUi() override;
196 void beforeSetRelationFeature( const
QgsRelation &newRelation, const
QgsFeature &newFeature ) override;
197 void afterSetRelationFeature() override;
199 void afterSetRelations() override;
203 void updateButtons();
206 void addFeatureGeometry();
209 void mapToolDeactivated();
210 void onDigitizingCompleted(
const QgsFeature &feature );
211 void onDigitizingCanceled( );
212 void multiEditItemSelectionChanged();
216 void digitizingFinished( );
218 enum class MultiEditFeatureType :
int
224 enum class MultiEditTreeWidgetRole :
int
226 FeatureType = Qt::UserRole + 1,
227 FeatureId = Qt::UserRole + 2
234 void updateUiSingleEdit();
235 void updateUiMultiEdit();
236 QTreeWidgetItem *createMultiEditTreeWidgetItem(
const QgsFeature &feature,
QgsVectorLayer *layer, MultiEditFeatureType type );
239 QPointer<QgsMessageBarItem> mMessageBarItem;
242 QToolButton *mToggleEditingButton =
nullptr;
243 QToolButton *mSaveEditsButton =
nullptr;
244 QToolButton *mAddFeatureButton =
nullptr;
245 QToolButton *mDuplicateFeatureButton =
nullptr;
246 QToolButton *mDeleteFeatureButton =
nullptr;
247 QToolButton *mLinkFeatureButton =
nullptr;
248 QToolButton *mUnlinkFeatureButton =
nullptr;
249 QToolButton *mZoomToFeatureButton =
nullptr;
250 QToolButton *mFormViewButton =
nullptr;
251 QToolButton *mTableViewButton =
nullptr;
252 QToolButton *mAddFeatureGeometryButton =
nullptr;
253 QLabel *mMultiEditInfoLabel =
nullptr;
254 QStackedWidget *mStackedWidget =
nullptr;
255 QWidget *mMultiEditStackedWidgetPage =
nullptr;
256 QTreeWidget *mMultiEditTreeWidget =
nullptr;
258 QButtonGroup *mViewModeButtonGroup =
nullptr;
261 Buttons mButtonsVisibility = Button::AllButtons;
262 bool mShowFirstFeature =
true;
263 bool mAllowAddChildFeatureWithNoGeometry =
true;
265 QList<QTreeWidgetItem *> mMultiEditPreviousSelectedItems;
268 friend class TestQgsRelationEditorWidget;
304 void setConfig(
const QVariantMap &config );
323 QString type()
const override;
325 QString name()
const override;
This class contains context information for attribute editor widgets.
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 unique ID, geometry and a list of field...
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