QGIS API Documentation
3.40.0-Bratislava (b56115d8743)
Loading...
Searching...
No Matches
src
core
textrenderer
qgstextblockformat.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgstextblockformat.h
3
-----------------
4
begin : September 2024
5
copyright : (C) Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSTEXTBLOCKFORMAT_H
17
#define QGSTEXTBLOCKFORMAT_H
18
19
#include "
qgis_sip.h
"
20
#include "qgis_core.h"
21
#include "
qgis.h
"
22
23
#include <QFont>
24
#include <QColor>
25
26
class
QTextBlockFormat;
27
class
QgsRenderContext
;
28
41
class
CORE_EXPORT
QgsTextBlockFormat
42
{
43
public
:
44
45
QgsTextBlockFormat
() =
default
;
46
50
QgsTextBlockFormat
(
const
QTextBlockFormat &format );
51
53
enum class
BooleanValue
54
{
55
NotSet,
56
SetTrue,
57
SetFalse,
58
};
59
71
void
overrideWith(
const
QgsTextBlockFormat
&other );
72
81
bool
hasHorizontalAlignmentSet
()
const
{
return
mHasHorizontalAlignSet; }
82
91
void
setHasHorizontalAlignmentSet
(
bool
set ) { mHasHorizontalAlignSet = set; }
92
101
Qgis::TextHorizontalAlignment
horizontalAlignment
()
const
{
return
mHorizontalAlign; }
102
111
void
setHorizontalAlignment
(
Qgis::TextHorizontalAlignment
alignment ) { mHorizontalAlign = alignment; }
112
122
void
updateFontForFormat( QFont &font,
const
QgsRenderContext
&context,
double
scaleFactor = 1.0 )
const
;
123
124
private
:
125
126
bool
mHasHorizontalAlignSet =
false
;
127
Qgis::TextHorizontalAlignment
mHorizontalAlign =
Qgis::TextHorizontalAlignment::Left
;
128
129
};
130
131
#endif
// QGSTEXTBLOCKFORMAT_H
Qgis::TextHorizontalAlignment
TextHorizontalAlignment
Text horizontal alignment.
Definition
qgis.h:2732
Qgis::TextHorizontalAlignment::Left
@ Left
Left align.
QgsRenderContext
Contains information about the context of a rendering operation.
Definition
qgsrendercontext.h:62
QgsTextBlockFormat
Stores information relating to individual block formatting.
Definition
qgstextblockformat.h:42
QgsTextBlockFormat::horizontalAlignment
Qgis::TextHorizontalAlignment horizontalAlignment() const
Returns the format horizontal alignment.
Definition
qgstextblockformat.h:101
QgsTextBlockFormat::setHasHorizontalAlignmentSet
void setHasHorizontalAlignmentSet(bool set)
Sets whether the format has an explicit horizontal alignment set.
Definition
qgstextblockformat.h:91
QgsTextBlockFormat::setHorizontalAlignment
void setHorizontalAlignment(Qgis::TextHorizontalAlignment alignment)
Sets the format horizontal alignment.
Definition
qgstextblockformat.h:111
QgsTextBlockFormat::hasHorizontalAlignmentSet
bool hasHorizontalAlignmentSet() const
Returns true if the format has an explicit horizontal alignment set.
Definition
qgstextblockformat.h:81
QgsTextBlockFormat::BooleanValue
BooleanValue
Status values for boolean format properties.
Definition
qgstextblockformat.h:54
QgsTextBlockFormat::QgsTextBlockFormat
QgsTextBlockFormat()=default
qgis.h
qgis_sip.h
Generated on Mon Oct 28 2024 22:06:03 for QGIS API Documentation by
1.9.8