QGIS API Documentation
3.22.4-Białowieża (ce8e65e95e)
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Related Functions
3
a
b
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
Files
File List
File Members
All
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Variables
a
b
c
d
e
f
g
h
i
l
n
o
p
q
r
s
t
u
w
Typedefs
3
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
c
l
s
t
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
x
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
core
textrenderer
qgstextblock.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgstextblock.h
3
---------------
4
begin : May 2020
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 QGSTEXTBLOCK_H
17
#define QGSTEXTBLOCK_H
18
19
#include "
qgis_sip.h
"
20
#include "qgis_core.h"
21
#include "
qgstextfragment.h
"
22
#include "
qgsstringutils.h
"
23
#include <QVector>
24
35
class
CORE_EXPORT
QgsTextBlock
36
{
37
38
public
:
39
43
QgsTextBlock
() =
default
;
44
48
explicit
QgsTextBlock
(
const
QgsTextFragment
&fragment );
49
55
QString toPlainText()
const
;
56
60
void
append(
const
QgsTextFragment
&fragment );
61
65
void
append(
QgsTextFragment
&&fragment )
SIP_SKIP
;
66
70
void
clear();
71
75
bool
empty()
const
;
76
80
int
size()
const
;
81
87
void
applyCapitalization(
QgsStringUtils::Capitalization
capitalization );
88
89
#ifdef SIP_RUN
90
int
__len__()
const
;
91
% MethodCode
92
sipRes = sipCpp->size();
93
% End
94
#endif
95
96
#ifndef SIP_RUN
97
101
const
QgsTextFragment
&at(
int
index )
const
SIP_FACTORY
;
102
#else
103
109
const
QgsTextFragment
&at(
int
index )
const
SIP_FACTORY
;
110
% MethodCode
111
if
( a0 < 0 || a0 >= sipCpp->size() )
112
{
113
PyErr_SetString( PyExc_KeyError, QByteArray::number( a0 ) );
114
sipIsErr = 1;
115
}
116
else
117
{
118
sipRes =
new
QgsTextFragment
( sipCpp->at( a0 ) );
119
}
120
% End
121
#endif
122
126
QgsTextFragment
&operator[](
int
index )
SIP_FACTORY
;
127
#ifdef SIP_RUN
128
% MethodCode
129
SIP_SSIZE_T idx = sipConvertFromSequenceIndex( a0, sipCpp->size() );
130
if
( idx < 0 )
131
sipIsErr = 1;
132
else
133
sipRes =
new
QgsTextFragment
( sipCpp->operator[]( idx ) );
134
% End
135
#endif
136
137
#ifndef SIP_RUN
139
QVector< QgsTextFragment >::const_iterator begin()
const
;
140
QVector< QgsTextFragment >::const_iterator end()
const
;
142
#endif
143
144
private
:
145
146
QVector< QgsTextFragment > mFragments;
147
148
};
149
150
#endif
// QGSTEXTBLOCK_H
QgsStringUtils::Capitalization
Capitalization
Capitalization options.
Definition:
qgsstringutils.h:190
QgsTextBlock
Represents a block of text consisting of one or more QgsTextFragment objects.
Definition:
qgstextblock.h:36
QgsTextBlock::QgsTextBlock
QgsTextBlock()=default
Constructor for an empty text block.
QgsTextFragment
Stores a fragment of text along with formatting overrides to be used when rendering the fragment.
Definition:
qgstextfragment.h:36
qgis_sip.h
SIP_SKIP
#define SIP_SKIP
Definition:
qgis_sip.h:126
SIP_FACTORY
#define SIP_FACTORY
Definition:
qgis_sip.h:76
qgsstringutils.h
qgstextfragment.h
Generated on Thu Feb 24 2022 10:41:09 for QGIS API Documentation by
1.9.1