Skip to content

Commit

Permalink
add dox to duplicated enum in QgsAttributeEditorRelation and QgsRelat…
Browse files Browse the repository at this point in the history
…ionEditorWidget

also remove leftover
  • Loading branch information
3nids committed Jun 1, 2021
1 parent 3491f40 commit 727a9a8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
Expand Up @@ -165,7 +165,6 @@ Sets the relation editor configuration
QFlags<QgsAttributeEditorRelation::Button> operator|(QgsAttributeEditorRelation::Button f1, QFlags<QgsAttributeEditorRelation::Button> f2);



/************************************************************************
* This file has been generated automatically from *
* *
Expand Down
4 changes: 4 additions & 0 deletions src/core/editform/qgsattributeeditorrelation.cpp
Expand Up @@ -66,16 +66,20 @@ void QgsAttributeEditorRelation::loadConfiguration( const QDomElement &element,
{
if ( element.hasAttribute( "buttons" ) )
{
Q_NOWARN_DEPRECATED_PUSH
QString buttonString = element.attribute( QStringLiteral( "buttons" ), qgsFlagValueToKeys( QgsAttributeEditorRelation::Button::AllButtons ) );
config.insert( "buttons", qgsFlagValueToKeys( qgsFlagKeysToValue( buttonString, QgsAttributeEditorRelation::Button::AllButtons ) ) );
Q_NOWARN_DEPRECATED_POP
}
else
{
// pre QGIS 3.16 compatibility
Q_NOWARN_DEPRECATED_PUSH
QgsAttributeEditorRelation::Buttons buttons = QgsAttributeEditorRelation::Button::AllButtons;
buttons.setFlag( QgsAttributeEditorRelation::Button::Link, element.attribute( QStringLiteral( "showLinkButton" ), QStringLiteral( "1" ) ).toInt() );
buttons.setFlag( QgsAttributeEditorRelation::Button::Unlink, element.attribute( QStringLiteral( "showUnlinkButton" ), QStringLiteral( "1" ) ).toInt() );
buttons.setFlag( QgsAttributeEditorRelation::Button::SaveChildEdits, element.attribute( QStringLiteral( "showSaveChildEditsButton" ), QStringLiteral( "1" ) ).toInt() );
Q_NOWARN_DEPRECATED_POP
config.insert( "buttons", qgsFlagValueToKeys( buttons ) );
}
}
Expand Down
10 changes: 8 additions & 2 deletions src/core/editform/qgsattributeeditorrelation.h
Expand Up @@ -36,9 +36,10 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement

/**
* Possible buttons shown in the relation editor
* \deprecated since QGIS 3.18 use QgsRelationEditorWidget::Button instead
* \since QGIS 3.16
*/
enum Button
enum Q_DECL_DEPRECATED Button
{
Link = 1 << 1, //!< Link button
Unlink = 1 << 2, //!< Unlink button
Expand All @@ -49,9 +50,11 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
ZoomToChildFeature = 1 << 7, //!< Zoom to child feature
AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature //!< All buttons
};
Q_NOWARN_DEPRECATED_PUSH
Q_ENUM( Button )
Q_DECLARE_FLAGS( Buttons, Button )
Q_FLAG( Buttons )
Q_NOWARN_DEPRECATED_POP

/**
* \deprecated since QGIS 3.0.2. The name parameter is not used for anything and overwritten by the relationId internally.
Expand Down Expand Up @@ -183,15 +186,18 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
QString typeIdentifier() const override;
QString mRelationId;
QgsRelation mRelation;
Q_NOWARN_DEPRECATED_PUSH
Buttons mButtons = Buttons( Button::AllButtons );
Q_NOWARN_DEPRECATED_POP
bool mForceSuppressFormPopup = false;
QVariant mNmRelationId;
QString mLabel;
QString mRelationWidgetTypeId;
QVariantMap mRelationEditorConfig;
};

Q_NOWARN_DEPRECATED_PUSH
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsAttributeEditorRelation::Buttons )

Q_NOWARN_DEPRECATED_POP

#endif // QGSATTRIBUTEEDITORRELATION_H
1 change: 1 addition & 0 deletions src/gui/qgsrelationeditorwidget.h
Expand Up @@ -95,6 +95,7 @@ class GUI_EXPORT QgsRelationEditorWidget : public QgsAbstractRelationEditorWidge

/**
* Possible buttons shown in the relation editor
* \since QGIS 3.18
*/
enum Button
{
Expand Down
1 change: 0 additions & 1 deletion src/gui/vector/qgsattributesformproperties.h
Expand Up @@ -71,7 +71,6 @@ class GUI_EXPORT QgsAttributesFormProperties : public QWidget, public QgsExpress
{
operator QVariant();

QgsAttributeEditorRelation::Buttons buttons = QgsAttributeEditorRelation::Button::AllButtons;
QString mRelationWidgetType;
QVariantMap mRelationWidgetConfig;
QVariant nmRelationId;
Expand Down

0 comments on commit 727a9a8

Please sign in to comment.