QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsquickutils.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsquickutils.h
3  --------------------------------------
4  Date : Nov 2017
5  Copyright : (C) 2017 by Peter Petrik
6  Email : zilolv 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 QGSQUICKUTILS_H
17 #define QGSQUICKUTILS_H
18 
19 
20 #include <QObject>
21 #include <QString>
22 
23 #include "qgis.h"
24 #include "qgsmessagelog.h"
25 
26 #include "qgsquickmapsettings.h"
27 #include "qgis_quick.h"
28 
30 
40 class QUICK_EXPORT QgsQuickUtils: public QObject
41 {
42  Q_OBJECT
43 
55  Q_PROPERTY( qreal dp READ screenDensity CONSTANT )
56 
57  public:
59  QgsQuickUtils( QObject *parent = nullptr );
61  ~QgsQuickUtils() = default;
62 
64  qreal screenDensity() const;
65 
69  Q_INVOKABLE double screenUnitsToMeters( QgsQuickMapSettings *mapSettings, int baseLengthPixels ) const;
70 
72  Q_INVOKABLE void logMessage( const QString &message,
73  const QString &tag = QString( "QgsQuick" ),
75 
81  QString dumpScreenInfo() const;
82 
83  private:
84  static qreal calculateScreenDensity();
85 
86  qreal mScreenDensity;
87 };
88 
89 #endif // QGSQUICKUTILS_H
Encapsulating the common utilies for QgsQuick library.
Definition: qgsquickutils.h:40
MessageLevel
Level for messages This will be used both for message log and message bar in application.
Definition: qgis.h:78
The QgsQuickMapSettings class encapsulates QgsMapSettings class to offer settings of configuration of...
This class represents a coordinate reference system (CRS).