Skip to content

Commit

Permalink
remove scoped enum
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Jul 13, 2020
1 parent 56bfeac commit 1c9211a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
11 changes: 0 additions & 11 deletions python/core/auto_additions/qgsattributeeditorelement.py
@@ -1,15 +1,4 @@
# The following has been generated automatically from src/core/qgsattributeeditorelement.h
# monkey patching scoped based enum
QgsAttributeEditorRelation.Button.Link.__doc__ = "Link button"
QgsAttributeEditorRelation.Button.Unlink.__doc__ = "Unlink button"
QgsAttributeEditorRelation.Button.SaveChildEdits.__doc__ = "Save child edits button"
QgsAttributeEditorRelation.Button.AddChildFeature.__doc__ = "Add child feature (as in some projects we only want to allow to link/unlink existing features)"
QgsAttributeEditorRelation.Button.DuplicateChildFeature.__doc__ = "Duplicate child feature"
QgsAttributeEditorRelation.Button.DeleteChildFeature.__doc__ = "Delete child feature button"
QgsAttributeEditorRelation.Button.ZoomToChildFeature.__doc__ = "Zoom to child feature"
QgsAttributeEditorRelation.Button.AllButtons.__doc__ = "All buttons"
QgsAttributeEditorRelation.Button.__doc__ = 'Possible buttons shown in the relation editor\n\n.. versionadded:: 3.16\n\n' + '* ``Link``: ' + QgsAttributeEditorRelation.Button.Link.__doc__ + '\n' + '* ``Unlink``: ' + QgsAttributeEditorRelation.Button.Unlink.__doc__ + '\n' + '* ``SaveChildEdits``: ' + QgsAttributeEditorRelation.Button.SaveChildEdits.__doc__ + '\n' + '* ``AddChildFeature``: ' + QgsAttributeEditorRelation.Button.AddChildFeature.__doc__ + '\n' + '* ``DuplicateChildFeature``: ' + QgsAttributeEditorRelation.Button.DuplicateChildFeature.__doc__ + '\n' + '* ``DeleteChildFeature``: ' + QgsAttributeEditorRelation.Button.DeleteChildFeature.__doc__ + '\n' + '* ``ZoomToChildFeature``: ' + QgsAttributeEditorRelation.Button.ZoomToChildFeature.__doc__ + '\n' + '* ``AllButtons``: ' + QgsAttributeEditorRelation.Button.AllButtons.__doc__
# --
QgsAttributeEditorRelation.Button.baseClass = QgsAttributeEditorRelation
QgsAttributeEditorRelation.Buttons.baseClass = QgsAttributeEditorRelation
Buttons = QgsAttributeEditorRelation # dirty hack since SIP seems to introduce the flags in module
4 changes: 1 addition & 3 deletions python/core/auto_generated/qgsattributeeditorelement.sip.in
Expand Up @@ -287,7 +287,7 @@ This element will load a relation editor onto the form.

public:

enum class Button
enum Button
{
Link,
Unlink,
Expand All @@ -298,11 +298,9 @@ This element will load a relation editor onto the form.
ZoomToChildFeature,
AllButtons
};

typedef QFlags<QgsAttributeEditorRelation::Button> Buttons;



QgsAttributeEditorRelation( const QString &name, const QString &relationId, QgsAttributeEditorElement *parent );
%Docstring

Expand Down
8 changes: 1 addition & 7 deletions src/core/qgsattributeeditorelement.h
Expand Up @@ -340,7 +340,7 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
* Possible buttons shown in the relation editor
* \since QGIS 3.16
*/
enum class Button : int
enum Button
{
Link = 1 << 1, //!< Link button
Unlink = 1 << 2, //!< Unlink button
Expand All @@ -351,15 +351,9 @@ class CORE_EXPORT QgsAttributeEditorRelation : public QgsAttributeEditorElement
ZoomToChildFeature = 1 << 7, //!< Zoom to child feature
AllButtons = Link | Unlink | SaveChildEdits | AddChildFeature | DuplicateChildFeature | DeleteChildFeature | ZoomToChildFeature //!< All buttons
};

Q_ENUM( Button )
Q_DECLARE_FLAGS( Buttons, Button )
#if QT_VERSION >= QT_VERSION_CHECK( 5, 12, 0 )
Q_FLAG( Buttons )
#else
Q_ENUM( Buttons )
#endif


/**
* \deprecated since QGIS 3.0.2. The name parameter is not used for anything and overwritten by the relationId internally.
Expand Down

0 comments on commit 1c9211a

Please sign in to comment.