QGIS API Documentation 3.99.0-Master (357b655ed83)
Loading...
Searching...
No Matches
qgsmeasureutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeasureutils.h
3 --------------------
4 begin : February 2026
5 copyright : (C) 2026 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 QGSMEASUREUTILS_H
19#define QGSMEASUREUTILS_H
20
21#include "qgis.h"
22#include "qgis_core.h"
23
24#include <QObject>
25#include <QString>
26
27class QgsProject;
28
35class CORE_EXPORT QgsMeasureUtils
36{
37 Q_GADGET
38
39 public:
40
45 Q_INVOKABLE static QString formatAreaForProject( QgsProject *project, double area, Qgis::AreaUnit unit );
46
51 Q_INVOKABLE static QString formatDistanceForProject( QgsProject *project, double distance, Qgis::DistanceUnit unit );
52
53};
54
55
56#endif //QGSMEASUREUTILS_H
DistanceUnit
Units of distance.
Definition qgis.h:5120
AreaUnit
Units of area.
Definition qgis.h:5197
Utilities for handling and formatting measurements.
static Q_INVOKABLE QString formatAreaForProject(QgsProject *project, double area, Qgis::AreaUnit unit)
Formats an area measurement (with the specified unit) for use with a project, respecting the project'...
static Q_INVOKABLE QString formatDistanceForProject(QgsProject *project, double distance, Qgis::DistanceUnit unit)
Formats a distance measurement (with the specified unit) for use with a project, respecting the proje...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:113