From 6ec369e6b7803098128971f598ec0671a90435d0 Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sat, 2 May 2020 08:39:12 +1000 Subject: [PATCH] Travis says no to enum class --- python/core/auto_additions/qgslabeling.py | 5 ----- python/core/auto_generated/labeling/qgslabeling.sip.in | 2 +- src/core/labeling/qgslabeling.h | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/python/core/auto_additions/qgslabeling.py b/python/core/auto_additions/qgslabeling.py index 9884592bc6f..a1d471b4661 100644 --- a/python/core/auto_additions/qgslabeling.py +++ b/python/core/auto_additions/qgslabeling.py @@ -6,8 +6,3 @@ QgsLabeling.LinePlacementFlag.BelowLine.__doc__ = "Labels can be placed below a QgsLabeling.LinePlacementFlag.MapOrientation.__doc__ = "Signifies that the AboveLine and BelowLine flags should respect the map's orientation rather than the feature's orientation. For example, AboveLine will always result in label's being placed above a line, regardless of the line's direction." QgsLabeling.LinePlacementFlag.__doc__ = 'Line placement flags, which control how candidates are generated for a linear feature.\n\n' + '* ``OnLine``: ' + QgsLabeling.LinePlacementFlag.OnLine.__doc__ + '\n' + '* ``AboveLine``: ' + QgsLabeling.LinePlacementFlag.AboveLine.__doc__ + '\n' + '* ``BelowLine``: ' + QgsLabeling.LinePlacementFlag.BelowLine.__doc__ + '\n' + '* ``MapOrientation``: ' + QgsLabeling.LinePlacementFlag.MapOrientation.__doc__ # -- -# monkey patching scoped based enum -QgsLabeling.PolygonPlacementFlag.AllowPlacementOutsideOfPolygon.__doc__ = "Labels can be placed outside of a polygon feature" -QgsLabeling.PolygonPlacementFlag.AllowPlacementInsideOfPolygon.__doc__ = "Labels can be placed inside a polygon feature" -QgsLabeling.PolygonPlacementFlag.__doc__ = 'Polygon placement flags, which control how candidates are generated for a polygon feature.\n\n.. versionadded:: 3.14\n\n' + '* ``AllowPlacementOutsideOfPolygon``: ' + QgsLabeling.PolygonPlacementFlag.AllowPlacementOutsideOfPolygon.__doc__ + '\n' + '* ``AllowPlacementInsideOfPolygon``: ' + QgsLabeling.PolygonPlacementFlag.AllowPlacementInsideOfPolygon.__doc__ -# -- diff --git a/python/core/auto_generated/labeling/qgslabeling.sip.in b/python/core/auto_generated/labeling/qgslabeling.sip.in index 28f083ca7d1..d39a56cf548 100644 --- a/python/core/auto_generated/labeling/qgslabeling.sip.in +++ b/python/core/auto_generated/labeling/qgslabeling.sip.in @@ -32,7 +32,7 @@ Contains constants and enums relating to labeling. typedef QFlags LinePlacementFlags; - enum class PolygonPlacementFlag + enum PolygonPlacementFlag { AllowPlacementOutsideOfPolygon, AllowPlacementInsideOfPolygon, diff --git a/src/core/labeling/qgslabeling.h b/src/core/labeling/qgslabeling.h index 2453aa8b4b7..5a8888dd300 100644 --- a/src/core/labeling/qgslabeling.h +++ b/src/core/labeling/qgslabeling.h @@ -49,7 +49,7 @@ class CORE_EXPORT QgsLabeling * * \since QGIS 3.14 */ - enum class PolygonPlacementFlag : int + enum PolygonPlacementFlag { AllowPlacementOutsideOfPolygon = 1 << 0, //!< Labels can be placed outside of a polygon feature AllowPlacementInsideOfPolygon = 1 << 1, //!< Labels can be placed inside a polygon feature