1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/textrenderer/qgstextblockformat.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsTextBlockFormat
{
%Docstring(signature="appended")
Stores information relating to individual block formatting.
These options encapsulate formatting options which override the default
settings from a :py:class:`QgsTextFormat` for individual text blocks.
.. warning::
This API is not considered stable and may change in future QGIS versions.
.. versionadded:: 3.40
%End
%TypeHeaderCode
#include "qgstextblockformat.h"
%End
public:
QgsTextBlockFormat();
QgsTextBlockFormat( const QTextBlockFormat &format );
%Docstring
Constructor for QgsTextBlockFormat, based on the specified
QTextBlockFormat ``format``.
%End
enum class BooleanValue
{
NotSet,
SetTrue,
SetFalse,
};
void overrideWith( const QgsTextBlockFormat &other );
%Docstring
Override all the default/unset properties of the current block format
with the settings from another format.
This will replace any default/unset existing settings with the settings
from ``other``.
Any settings which are default/unset in ``other`` will be left
unchanged.
:param other: The format to override with.
%End
bool hasHorizontalAlignmentSet() const;
%Docstring
Returns ``True`` if the format has an explicit horizontal alignment set.
If ``False`` is returned then the horizontal alignment will be
inherited.
.. seealso:: :py:func:`setHasHorizontalAlignmentSet`
.. seealso:: :py:func:`horizontalAlignment`
%End
void setHasHorizontalAlignmentSet( bool set );
%Docstring
Sets whether the format has an explicit horizontal alignment ``set``.
If ``set`` is ``False`` then the horizontal alignment will be inherited.
.. seealso:: :py:func:`hasHorizontalAlignmentSet`
.. seealso:: :py:func:`setHorizontalAlignment`
%End
Qgis::TextHorizontalAlignment horizontalAlignment() const;
%Docstring
Returns the format horizontal alignment.
This property is only respected if
:py:func:`~QgsTextBlockFormat.hasHorizontalAlignmentSet` is ``True``.
.. seealso:: :py:func:`hasHorizontalAlignmentSet`
.. seealso:: :py:func:`setHorizontalAlignment`
%End
void setHorizontalAlignment( Qgis::TextHorizontalAlignment alignment );
%Docstring
Sets the format horizontal ``alignment``.
This property is only respected if
:py:func:`~QgsTextBlockFormat.hasHorizontalAlignmentSet` is ``True``.
.. seealso:: :py:func:`hasHorizontalAlignmentSet`
.. seealso:: :py:func:`horizontalAlignment`
%End
void updateFontForFormat( QFont &font, const QgsRenderContext &context, double scaleFactor = 1.0 ) const;
%Docstring
Updates the specified ``font`` in place, applying block formatting
options which are applicable on a font level when rendered in the given
``context``.
The optional ``scaleFactor`` parameter can specify a font size scaling
factor. It is recommended to set this to
:py:func:`QgsTextRenderer.calculateScaleFactorForFormat()` and then
manually calculations based on the resultant font metrics. Failure to do
so will result in poor quality text rendering at small font sizes.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/textrenderer/qgstextblockformat.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|