QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgsmapdecoration.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmapdecoration.h
3 ----------------
4 begin : April 2017
5 copyright : (C) 2017 by Mathieu Pellerin
6 email : nirvn dot asia 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 QGSMAPDECORATION_H
19#define QGSMAPDECORATION_H
20
21#include "qgis_core.h"
22
23#include <QString>
24
25class QgsMapSettings;
27
34class CORE_EXPORT QgsMapDecoration
35{
36 public:
37 QgsMapDecoration() = default;
38
39 virtual ~QgsMapDecoration() = default;
40
44 virtual void render( const QgsMapSettings &mapSettings, QgsRenderContext &context ) = 0;
45
50 const QString displayName() const { return mDisplayName; }
51
57 virtual bool hasFixedMapPosition() const { return false; }
58
59 protected:
64 void setDisplayName( const QString &name ) { mDisplayName = name; }
65
66 private:
67 QString mDisplayName;
68};
69
70#endif //QGSMAPDECORATION_H
virtual bool hasFixedMapPosition() const
Returns true if the decoration is attached to a fixed map position (e.g grid, layout extent),...
const QString displayName() const
Returns the map decoration display name.
virtual void render(const QgsMapSettings &mapSettings, QgsRenderContext &context)=0
Renders a map decoration.
virtual ~QgsMapDecoration()=default
QgsMapDecoration()=default
void setDisplayName(const QString &name)
Sets the map decoration display name.
Contains configuration for rendering maps.
Contains information about the context of a rendering operation.