QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
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
layout
qgslayoutmeasurementconverter.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgslayoutmeasurementconverter.h
3
-------------------------------
4
begin : June 2017
5
copyright : (C) 2017 by Nyall Dawson
6
email : nyall dot dawson at gmail dot com
7
***************************************************************************/
8
9
/***************************************************************************
10
* *
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
15
* *
16
***************************************************************************/
17
18
#ifndef QGSLAYOUTMEASUREMENTCONVERTER_H
19
#define QGSLAYOUTMEASUREMENTCONVERTER_H
20
21
#include "qgis_core.h"
22
#include "
qgsunittypes.h
"
23
#include "
qgslayoutmeasurement.h
"
24
#include "
qgslayoutsize.h
"
25
#include "
qgslayoutpoint.h
"
26
#include <QSizeF>
27
#include <QPointF>
28
29
40
class
CORE_EXPORT
QgsLayoutMeasurementConverter
41
{
42
public
:
43
47
QgsLayoutMeasurementConverter
() =
default
;
48
54
void
setDpi
(
const
double
dpi ) { mDpi = dpi; }
55
61
double
dpi
()
const
{
return
mDpi; }
62
69
QgsLayoutMeasurement
convert(
QgsLayoutMeasurement
measurement,
QgsUnitTypes::LayoutUnit
targetUnits )
const
;
70
77
QgsLayoutSize
convert(
const
QgsLayoutSize
&size,
QgsUnitTypes::LayoutUnit
targetUnits )
const
;
78
85
QgsLayoutPoint
convert(
const
QgsLayoutPoint
&point,
QgsUnitTypes::LayoutUnit
targetUnits )
const
;
86
87
private
:
88
89
double
mDpi = 300.0;
90
91
double
convertToMillimeters(
QgsLayoutMeasurement
measurement )
const
;
92
double
convertToCentimeters(
QgsLayoutMeasurement
measurement )
const
;
93
double
convertToMeters(
QgsLayoutMeasurement
measurement )
const
;
94
double
convertToInches(
QgsLayoutMeasurement
measurement )
const
;
95
double
convertToFeet(
QgsLayoutMeasurement
measurement )
const
;
96
double
convertToPoints(
QgsLayoutMeasurement
measurement )
const
;
97
double
convertToPicas(
QgsLayoutMeasurement
measurement )
const
;
98
double
convertToPixels(
QgsLayoutMeasurement
measurement )
const
;
99
100
};
101
102
#endif // QGSLAYOUTMEASUREMENTCONVERTER_H
QgsUnitTypes::LayoutUnit
LayoutUnit
Layout measurement units.
Definition:
qgsunittypes.h:181
qgsunittypes.h
QgsLayoutMeasurementConverter::setDpi
void setDpi(const double dpi)
Sets the dots per inch (dpi) for the measurement converter.
Definition:
qgslayoutmeasurementconverter.h:54
qgslayoutsize.h
qgslayoutpoint.h
qgslayoutmeasurement.h
QgsLayoutMeasurementConverter
This class provides a method of converting QgsLayoutMeasurements from one unit to another....
Definition:
qgslayoutmeasurementconverter.h:40
QgsLayoutMeasurementConverter::dpi
double dpi() const
Returns the Dots per inch (DPI) of the measurement converter.
Definition:
qgslayoutmeasurementconverter.h:61
QgsLayoutSize
This class provides a method of storing sizes, consisting of a width and height, for use in QGIS layo...
Definition:
qgslayoutsize.h:40
QgsLayoutPoint
This class provides a method of storing points, consisting of an x and y coordinate,...
Definition:
qgslayoutpoint.h:39
QgsLayoutMeasurement
This class provides a method of storing measurements for use in QGIS layouts using a variety of diffe...
Definition:
qgslayoutmeasurement.h:33
Generated on Sun Sep 11 2022 00:03:17 for QGIS API Documentation by
1.8.17