From 66a3b090da750ea8ea57f74f4313d65319e30d3d Mon Sep 17 00:00:00 2001 From: Nyall Dawson Date: Sun, 3 May 2020 15:17:04 +1000 Subject: [PATCH] Maybe even LESS enum classes will help? --- python/core/auto_additions/qgslabeling.py | 8 -------- python/core/auto_generated/labeling/qgslabeling.sip.in | 2 +- src/core/labeling/qgslabeling.h | 2 +- 3 files changed, 2 insertions(+), 10 deletions(-) delete mode 100644 python/core/auto_additions/qgslabeling.py diff --git a/python/core/auto_additions/qgslabeling.py b/python/core/auto_additions/qgslabeling.py deleted file mode 100644 index a1d471b46610..000000000000 --- a/python/core/auto_additions/qgslabeling.py +++ /dev/null @@ -1,8 +0,0 @@ -# The following has been generated automatically from src/core/labeling/qgslabeling.h -# monkey patching scoped based enum -QgsLabeling.LinePlacementFlag.OnLine.__doc__ = "Labels can be placed directly over a line feature." -QgsLabeling.LinePlacementFlag.AboveLine.__doc__ = "Labels can be placed above a line feature. Unless MapOrientation is also specified this mode respects the direction of the line feature, so a line from right to left labels will have labels placed placed below the line feature." -QgsLabeling.LinePlacementFlag.BelowLine.__doc__ = "Labels can be placed below a line feature. Unless MapOrientation is also specified this mode respects the direction of the line feature, so a line from right to left labels will have labels placed placed above the line feature." -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__ -# -- diff --git a/python/core/auto_generated/labeling/qgslabeling.sip.in b/python/core/auto_generated/labeling/qgslabeling.sip.in index d39a56cf5488..bb2d65409e5b 100644 --- a/python/core/auto_generated/labeling/qgslabeling.sip.in +++ b/python/core/auto_generated/labeling/qgslabeling.sip.in @@ -22,7 +22,7 @@ Contains constants and enums relating to labeling. %End public: - enum class LinePlacementFlag + enum LinePlacementFlag { OnLine, AboveLine, diff --git a/src/core/labeling/qgslabeling.h b/src/core/labeling/qgslabeling.h index 5a8888dd300e..9c41b1c67431 100644 --- a/src/core/labeling/qgslabeling.h +++ b/src/core/labeling/qgslabeling.h @@ -35,7 +35,7 @@ class CORE_EXPORT QgsLabeling /** * Line placement flags, which control how candidates are generated for a linear feature. */ - enum class LinePlacementFlag : int + enum LinePlacementFlag { OnLine = 1, //!< Labels can be placed directly over a line feature. AboveLine = 2, //!< Labels can be placed above a line feature. Unless MapOrientation is also specified this mode respects the direction of the line feature, so a line from right to left labels will have labels placed placed below the line feature.