Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose some more classes to Python, but mark as unstable API
- Loading branch information
1 parent
0e13999
commit cb1e844
Showing
6 changed files
with
219 additions
and
4 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,7 @@ | ||
# The following has been generated automatically from src/core/textrenderer/qgstextcharacterformat.h | ||
# monkey patching scoped based enum | ||
QgsTextCharacterFormat.BooleanValue.NotSet.__doc__ = "Property is not set" | ||
QgsTextCharacterFormat.BooleanValue.True.__doc__ = "Property is set and ``True``" | ||
QgsTextCharacterFormat.BooleanValue.False.__doc__ = "Property is set and ``False``" | ||
QgsTextCharacterFormat.BooleanValue.__doc__ = 'Status values for boolean format properties\n\n' + '* ``NotSet``: ' + QgsTextCharacterFormat.BooleanValue.NotSet.__doc__ + '\n' + '* ``True``: ' + QgsTextCharacterFormat.BooleanValue.True.__doc__ + '\n' + '* ``False``: ' + QgsTextCharacterFormat.BooleanValue.False.__doc__ | ||
# -- |
122 changes: 122 additions & 0 deletions
122
python/core/auto_generated/textrenderer/qgstextcharacterformat.sip.in
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,122 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/textrenderer/qgstextcharacterformat.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
class QgsTextCharacterFormat | ||
{ | ||
%Docstring | ||
Stores information relating to individual character formatting. | ||
|
||
These options encapsulate formatting options which override the default | ||
settings from a QgsTextFormat for individual characters (or sets of characters). | ||
|
||
.. warning:: | ||
|
||
This API is not considered stable and may change in future QGIS versions. | ||
|
||
.. versionadded:: 3.14 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgstextcharacterformat.h" | ||
%End | ||
public: | ||
|
||
QgsTextCharacterFormat(); | ||
|
||
QgsTextCharacterFormat( const QTextCharFormat &format ); | ||
%Docstring | ||
Constructor for QgsTextCharacterFormat, based on the specified QTextCharFormat ``format``. | ||
%End | ||
|
||
enum class BooleanValue | ||
{ | ||
NotSet, | ||
True, | ||
False, | ||
}; | ||
|
||
QColor textColor() const; | ||
%Docstring | ||
Returns the character's text color, or an invalid color if no color override | ||
is set and the default format color should be used. | ||
|
||
.. seealso:: :py:func:`setTextColor` | ||
%End | ||
|
||
void setTextColor( const QColor &textColor ); | ||
%Docstring | ||
Sets the character's text ``color``. | ||
|
||
Set ``color`` to an invalid color if no color override | ||
is desired and the default format color should be used. | ||
|
||
.. seealso:: :py:func:`textColor` | ||
%End | ||
|
||
|
||
BooleanValue strikeOut() const; | ||
%Docstring | ||
Returns whether the format has strikethrough enabled. | ||
|
||
.. seealso:: :py:func:`setStrikeOut` | ||
%End | ||
|
||
void setStrikeOut( BooleanValue enabled ); | ||
%Docstring | ||
Sets whether the format has strikethrough ``enabled``. | ||
|
||
.. seealso:: :py:func:`strikeOut` | ||
%End | ||
|
||
BooleanValue underline() const; | ||
%Docstring | ||
Returns whether the format has underline enabled. | ||
|
||
.. seealso:: :py:func:`setUnderline` | ||
%End | ||
|
||
void setUnderline( BooleanValue enabled ); | ||
%Docstring | ||
Sets whether the format has underline ``enabled``. | ||
|
||
.. seealso:: :py:func:`underline` | ||
%End | ||
|
||
BooleanValue overline() const; | ||
%Docstring | ||
Returns whether the format has overline enabled. | ||
|
||
.. seealso:: :py:func:`setUnderline` | ||
%End | ||
|
||
void setOverline( BooleanValue enabled ); | ||
%Docstring | ||
Sets whether the format has overline ``enabled``. | ||
|
||
.. seealso:: :py:func:`overline` | ||
%End | ||
|
||
void updateFontForFormat( QFont &font ) const; | ||
%Docstring | ||
Updates the specified ``font`` in place, applying character formatting options which | ||
are applicable on a font level. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/textrenderer/qgstextcharacterformat.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
84 changes: 84 additions & 0 deletions
84
python/core/auto_generated/textrenderer/qgstextfragment.sip.in
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,84 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/textrenderer/qgstextfragment.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
class QgsTextFragment | ||
{ | ||
%Docstring | ||
Stores a fragment of text along with formatting overrides to be used when rendering the fragment. | ||
|
||
.. warning:: | ||
|
||
This API is not considered stable and may change in future QGIS versions. | ||
|
||
.. versionadded:: 3.14 | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgstextfragment.h" | ||
%End | ||
public: | ||
|
||
explicit QgsTextFragment( const QString &text, const QgsTextCharacterFormat &format = QgsTextCharacterFormat() ); | ||
%Docstring | ||
Constructor for QgsTextFragment, with the specified ``text`` and optional character ``format``. | ||
%End | ||
|
||
explicit QgsTextFragment( const QTextFragment &fragment ); | ||
%Docstring | ||
Constructor for QgsTextFragment, based on the specified QTextFragment ``fragment``. | ||
%End | ||
|
||
QString text() const; | ||
%Docstring | ||
Returns the text content of the fragment. | ||
|
||
.. seealso:: :py:func:`setText` | ||
%End | ||
|
||
void setText( const QString &text ); | ||
%Docstring | ||
Sets the ``text`` content of the fragment. | ||
|
||
.. seealso:: :py:func:`text` | ||
%End | ||
|
||
const QgsTextCharacterFormat &characterFormat() const; | ||
%Docstring | ||
Returns the character formatting for the fragment. | ||
|
||
.. seealso:: :py:func:`setCharacterFormat` | ||
%End | ||
|
||
void setCharacterFormat( const QgsTextCharacterFormat &format ); | ||
%Docstring | ||
Sets the character ``format`` for the fragment. | ||
|
||
.. seealso:: :py:func:`characterFormat` | ||
%End | ||
|
||
double horizontalAdvance( const QFont &font, bool fontHasBeenUpdatedForFragment = false ) const; | ||
%Docstring | ||
Returns the horizontal advance associated with this fragment, when rendered using | ||
the specified base ``font``. | ||
|
||
Set ``fontHasBeenUpdatedForFragment`` to ``True`` if ``font`` already represents the character | ||
format for this fragment. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/core/textrenderer/qgstextfragment.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