QGIS API Documentation 3.40.0-Bratislava (b56115d8743)
|
Stores information relating to individual block formatting. More...
#include <qgstextblockformat.h>
Public Types | |
enum class | BooleanValue { NotSet , SetTrue , SetFalse } |
Status values for boolean format properties. More... | |
Public Member Functions | |
QgsTextBlockFormat ()=default | |
QgsTextBlockFormat (const QTextBlockFormat &format) | |
Constructor for QgsTextBlockFormat, based on the specified QTextBlockFormat format. | |
bool | hasHorizontalAlignmentSet () const |
Returns true if the format has an explicit horizontal alignment set. | |
Qgis::TextHorizontalAlignment | horizontalAlignment () const |
Returns the format horizontal alignment. | |
void | overrideWith (const QgsTextBlockFormat &other) |
Override all the default/unset properties of the current block format with the settings from another format. | |
void | setHasHorizontalAlignmentSet (bool set) |
Sets whether the format has an explicit horizontal alignment set. | |
void | setHorizontalAlignment (Qgis::TextHorizontalAlignment alignment) |
Sets the format horizontal alignment. | |
void | updateFontForFormat (QFont &font, const QgsRenderContext &context, double scaleFactor=1.0) const |
Updates the specified font in place, applying block formatting options which are applicable on a font level when rendered in the given context. | |
Stores information relating to individual block formatting.
These options encapsulate formatting options which override the default settings from a QgsTextFormat for individual text blocks.
Definition at line 41 of file qgstextblockformat.h.
|
strong |
Status values for boolean format properties.
Enumerator | |
---|---|
NotSet | Property is not set. |
SetTrue | Property is set and |
SetFalse | Property is set and |
Definition at line 53 of file qgstextblockformat.h.
|
default |
QgsTextBlockFormat::QgsTextBlockFormat | ( | const QTextBlockFormat & | format | ) |
Constructor for QgsTextBlockFormat, based on the specified QTextBlockFormat format.
Definition at line 46 of file qgstextblockformat.cpp.
|
inline |
Returns true
if the format has an explicit horizontal alignment set.
If false
is returned then the horizontal alignment will be inherited.
Definition at line 81 of file qgstextblockformat.h.
|
inline |
Returns the format horizontal alignment.
This property is only respected if hasHorizontalAlignmentSet() is true
.
Definition at line 101 of file qgstextblockformat.h.
void QgsTextBlockFormat::overrideWith | ( | const QgsTextBlockFormat & | other | ) |
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.
other | The format to override with. |
Definition at line 51 of file qgstextblockformat.cpp.
|
inline |
Sets whether the format has an explicit horizontal alignment set.
If set is false
then the horizontal alignment will be inherited.
Definition at line 91 of file qgstextblockformat.h.
|
inline |
Sets the format horizontal alignment.
This property is only respected if hasHorizontalAlignmentSet() is true
.
Definition at line 111 of file qgstextblockformat.h.
void QgsTextBlockFormat::updateFontForFormat | ( | QFont & | font, |
const QgsRenderContext & | context, | ||
double | scaleFactor = 1.0 |
||
) | const |
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 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.
Definition at line 60 of file qgstextblockformat.cpp.