16 #ifndef QGSQUICKMAPSETTINGS_H
17 #define QGSQUICKMAPSETTINGS_H
19 #include "qgis_quick.h"
58 Q_PROPERTY(
QgsProject *project READ project WRITE setProject NOTIFY projectChanged )
68 Q_PROPERTY(
QgsRectangle extent READ extent WRITE setExtent NOTIFY extentChanged )
70 Q_PROPERTY(
QgsRectangle visibleExtent READ visibleExtent NOTIFY visibleExtentChanged )
72 Q_PROPERTY(
double mapUnitsPerPixel READ mapUnitsPerPixel NOTIFY mapUnitsPerPixelChanged )
74 Q_PROPERTY(
double mapUnitsPerPoint READ mapUnitsPerPoint NOTIFY mapUnitsPerPointChanged )
80 Q_PROPERTY(
double rotation READ rotation WRITE setRotation NOTIFY rotationChanged )
87 Q_PROPERTY( QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged )
94 Q_PROPERTY( QSize outputSize READ outputSize WRITE setOutputSize NOTIFY outputSizeChanged )
101 Q_PROPERTY(
double outputDpi READ outputDpi WRITE setOutputDpi NOTIFY outputDpiChanged )
118 Q_PROPERTY( QList<
QgsMapLayer *> layers READ layers WRITE setLayers NOTIFY layersChanged )
141 Q_INVOKABLE
void setCenter( const
QgsPoint ¢er );
144 double mapUnitsPerPixel() const;
147 Q_INVOKABLE
void setCenterToLayer(
QgsMapLayer *layer,
bool shouldZoom = true );
150 double mapUnitsPerPoint() const;
165 Q_INVOKABLE QPointF coordinateToScreen( const
QgsPoint &point ) const;
174 Q_INVOKABLE
QgsPoint screenToCoordinate( const QPointF &point ) const;
180 double rotation() const;
183 void setRotation(
double rotation );
186 QColor backgroundColor() const;
189 void setBackgroundColor( const QColor &color );
196 QSize outputSize() const;
203 void setOutputSize( QSize outputSize );
206 double outputDpi() const;
209 void setOutputDpi(
double outputDpi );
235 void setLayers( const QList<
QgsMapLayer *> &layers );
242 qreal devicePixelRatio() const;
250 void setDevicePixelRatio( const qreal &devicePixelRatio );
254 void projectChanged();
257 void extentChanged();
260 void destinationCrsChanged();
263 void mapUnitsPerPixelChanged();
265 void mapUnitsPerPointChanged();
268 void rotationChanged();
271 void backgroundColorChanged();
274 void visibleExtentChanged();
277 void outputSizeChanged();
280 void outputDpiChanged();
283 void layersChanged();
286 void devicePixelRatioChanged();
295 void onReadProject( const QDomDocument &doc );
305 qreal mDevicePixelRatio = 1.0;
308 #endif // QGSQUICKMAPSETTINGS_H