Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[quick] QgsQuickMapCanvasMap implements QgsMapCanvasInterface #8410

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/quickgui/qgsquickmapcanvasmap.cpp
Expand Up @@ -50,11 +50,16 @@ QgsQuickMapCanvasMap::QgsQuickMapCanvasMap( QQuickItem *parent )
setFlags( QQuickItem::ItemHasContents );
}

QgsQuickMapSettings *QgsQuickMapCanvasMap::mapSettings() const
QgsQuickMapSettings *QgsQuickMapCanvasMap::quickMapSettings() const
{
return mMapSettings.get();
}

const QgsMapSettings &QgsQuickMapCanvasMap::mapSettings() const
{
return mMapSettings->mapSettings();
}

void QgsQuickMapCanvasMap::zoom( QPointF center, qreal scale )
{
QgsRectangle extent = mMapSettings->extent();
Expand Down
15 changes: 11 additions & 4 deletions src/quickgui/qgsquickmapcanvasmap.h
Expand Up @@ -24,6 +24,7 @@

#include "qgsmapsettings.h"
#include "qgspoint.h"
#include "qgsmapcanvasinterface.h"

#include "qgis_quick.h"
#include "qgsquickmapsettings.h"
Expand All @@ -49,7 +50,7 @@ class QgsLabelingResults;
*
* \since QGIS 3.2
*/
class QUICK_EXPORT QgsQuickMapCanvasMap : public QQuickItem
class QUICK_EXPORT QgsQuickMapCanvasMap : public QQuickItem, public QgsMapCanvasInterface
{
Q_OBJECT

Expand All @@ -61,7 +62,7 @@ class QUICK_EXPORT QgsQuickMapCanvasMap : public QQuickItem
*
* This is a readonly property.
*/
Q_PROPERTY( QgsQuickMapSettings *mapSettings READ mapSettings )
Q_PROPERTY( QgsQuickMapSettings *quickMapSettings READ quickMapSettings )

/**
* When freeze property is set to true, the map canvas does not refresh.
Expand Down Expand Up @@ -95,8 +96,14 @@ class QUICK_EXPORT QgsQuickMapCanvasMap : public QQuickItem

QSGNode *updatePaintNode( QSGNode *oldNode, QQuickItem::UpdatePaintNodeData * ) override;

//! \copydoc QgsQuickMapCanvasMap::mapSettings
QgsQuickMapSettings *mapSettings() const;
//! \copydoc QgsQuickMapCanvasMap::quickMapSettings
QgsQuickMapSettings *quickMapSettings() const;

/**
* Rerturn the native map settings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returns

* \since QGIS 3.6
*/
const QgsMapSettings &mapSettings() const override;

//! \copydoc QgsQuickMapCanvasMap::freeze
bool freeze() const;
Expand Down