Maybe even LESS enum classes will help?

This commit is contained in:
Nyall Dawson 2020-05-03 15:17:04 +10:00
parent 4369ffb3cc
commit 66a3b090da
3 changed files with 2 additions and 10 deletions

View File

@ -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__
# --

View File

@ -22,7 +22,7 @@ Contains constants and enums relating to labeling.
%End
public:
enum class LinePlacementFlag
enum LinePlacementFlag
{
OnLine,
AboveLine,

View File

@ -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.