Skip to content
Permalink
Browse files

small fixes in qgs components

  • Loading branch information
PeterPetrik committed May 4, 2018
1 parent ab24042 commit c29c6676f9214149c1201efdf94d4ba2672cf379
@@ -47,7 +47,7 @@ void QgsQuickPlugin::registerTypes( const char *uri )
qRegisterMetaType< QgsAttributes > ( "QgsAttributes" );
qRegisterMetaType< QgsCoordinateReferenceSystem >( "QgsCoordinateReferenceSystem" );
qRegisterMetaType< QgsCoordinateTransformContext >( "QgsCoordinateTransformContext" );
qRegisterMetaType< QgsFeature > ( "QgsFeature " );
qRegisterMetaType< QgsFeature > ( "QgsFeature" );
qRegisterMetaType< QgsFeatureId > ( "QgsFeatureId" );
qRegisterMetaType< QgsPoint >( "QgsPoint" );
qRegisterMetaType< QgsPointXY >( "QgsPointXY" );
@@ -37,7 +37,6 @@ QgsQuickMapCanvasMap::QgsQuickMapCanvasMap( QQuickItem *parent )
connect( &mRefreshTimer, &QTimer::timeout, this, &QgsQuickMapCanvasMap::refreshMap );
connect( &mMapUpdateTimer, &QTimer::timeout, this, &QgsQuickMapCanvasMap::renderJobUpdated );

Q_ASSERT( mMapSettings );
connect( mMapSettings, &QgsQuickMapSettings::extentChanged, this, &QgsQuickMapCanvasMap::onExtentChanged );
connect( mMapSettings, &QgsQuickMapSettings::layersChanged, this, &QgsQuickMapCanvasMap::onLayersChanged );

@@ -51,6 +50,13 @@ QgsQuickMapCanvasMap::QgsQuickMapCanvasMap( QQuickItem *parent )
setFlags( QQuickItem::ItemHasContents );
}

QgsQuickMapCanvasMap::~QgsQuickMapCanvasMap()
{
Q_ASSERT( mMapSettings );
delete mMapSettings;
mMapSettings = nullptr;
}

QgsQuickMapSettings *QgsQuickMapCanvasMap::mapSettings() const
{
Q_ASSERT( mMapSettings );
@@ -89,7 +89,7 @@ class QUICK_EXPORT QgsQuickMapCanvasMap : public QQuickItem
public:
//! Create map canvas map
QgsQuickMapCanvasMap( QQuickItem *parent = nullptr );
~QgsQuickMapCanvasMap() = default;
~QgsQuickMapCanvasMap();

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

@@ -109,16 +109,16 @@ QgsRectangle QgsQuickMapSettings::visibleExtent() const
return mMapSettings.visibleExtent();
}

QPointF QgsQuickMapSettings::coordinateToScreen( const QgsPoint &p ) const
QPointF QgsQuickMapSettings::coordinateToScreen( const QgsPoint &point ) const
{
QgsPointXY pt( p.x(), p.y() );
QgsPointXY pt( point.x(), point.y() );
QgsPointXY pp = mMapSettings.mapToPixel().transform( pt );
return pp.toQPointF();
}

QgsPoint QgsQuickMapSettings::screenToCoordinate( const QPointF &p ) const
QgsPoint QgsQuickMapSettings::screenToCoordinate( const QPointF &point ) const
{
const QgsPointXY pp = mMapSettings.mapToPixel().toMapCoordinates( p.toPoint() );
const QgsPointXY pp = mMapSettings.mapToPixel().toMapCoordinates( point.toPoint() );
return QgsPoint( pp );
}

@@ -146,7 +146,7 @@ class QUICK_EXPORT QgsQuickMapSettings : public QObject
*
* \return A coordinate in pixel / screen space
*/
Q_INVOKABLE QPointF coordinateToScreen( const QgsPoint &p ) const;
Q_INVOKABLE QPointF coordinateToScreen( const QgsPoint &point ) const;


/**
@@ -156,7 +156,7 @@ class QUICK_EXPORT QgsQuickMapSettings : public QObject
*
* \return A coordinate in map coordinates
*/
Q_INVOKABLE QgsPoint screenToCoordinate( const QPointF &p ) const;
Q_INVOKABLE QgsPoint screenToCoordinate( const QPointF &point ) const;

//! \copydoc QgsMapSettings::setTransformContext()
void setTransformContext( const QgsCoordinateTransformContext &context );
@@ -12,13 +12,8 @@
* (at your option) any later version. *
* *
***************************************************************************/

#include <QDesktopWidget>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QString>
#include <QThread>

#include "qgis.h"
#include "qgscoordinatereferencesystem.h"

0 comments on commit c29c667

Please sign in to comment.
You can’t perform that action at this time.