Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create QgsLabeling class for labeling related enums and constants,
and avoid inclusion of pal header in a public QGIS header pal is an internal implementation detail -- it should not be exposed publicly
- Loading branch information
1 parent
15a6363
commit 0cd9557
Showing
14 changed files
with
168 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# 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__ | ||
# -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/labeling/qgslabeling.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
class QgsLabeling | ||
{ | ||
%Docstring | ||
|
||
Contains constants and enums relating to labeling. | ||
|
||
.. versionadded:: 3.12 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgslabeling.h" | ||
%End | ||
public: | ||
|
||
enum class LinePlacementFlag | ||
{ | ||
OnLine, | ||
AboveLine, | ||
BelowLine, | ||
MapOrientation, | ||
}; | ||
typedef QFlags<QgsLabeling::LinePlacementFlag> LinePlacementFlags; | ||
|
||
|
||
}; | ||
|
||
QFlags<QgsLabeling::LinePlacementFlag> operator|(QgsLabeling::LinePlacementFlag f1, QFlags<QgsLabeling::LinePlacementFlag> f2); | ||
|
||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/labeling/qgslabeling.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/*************************************************************************** | ||
qgslabeling.h | ||
-------------------------- | ||
Date : January 2020 | ||
Copyright : (C) 2020 by Nyall Dawson | ||
Email : nyall dot dawson at gmail dot com | ||
*************************************************************************** | ||
* * | ||
* This program is free software; you can redistribute it and/or modify * | ||
* it under the terms of the GNU General Public License as published by * | ||
* the Free Software Foundation; either version 2 of the License, or * | ||
* (at your option) any later version. * | ||
* * | ||
***************************************************************************/ | ||
|
||
#ifndef QGSLABELING_H | ||
#define QGSLABELING_H | ||
|
||
#include "qgis_core.h" | ||
#include "qgis_sip.h" | ||
#include <QFlags> | ||
|
||
/** | ||
* \ingroup core | ||
* \class QgsLabeling | ||
* | ||
* Contains constants and enums relating to labeling. | ||
* | ||
* \since QGIS 3.12 | ||
*/ | ||
class CORE_EXPORT QgsLabeling | ||
{ | ||
public: | ||
|
||
/** | ||
* Line placement flags, which control how candidates are generated for a linear feature. | ||
*/ | ||
enum class LinePlacementFlag : int | ||
{ | ||
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. | ||
BelowLine = 4, //!< 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. | ||
MapOrientation = 8, //!< 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. | ||
}; | ||
Q_DECLARE_FLAGS( LinePlacementFlags, LinePlacementFlag ) | ||
|
||
}; | ||
|
||
Q_DECLARE_OPERATORS_FOR_FLAGS( QgsLabeling::LinePlacementFlags ) | ||
|
||
#endif // QGSLABELING_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.