mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Don't break QgsMapCanvasSnappingUtils API
This commit is contained in:
parent
50f3a02eca
commit
c699ab5eb9
@ -23,7 +23,7 @@ Snapping utils instance that is connected to a canvas and updates the configurat
|
||||
#include "qgsmapcanvassnappingutils.h"
|
||||
%End
|
||||
public:
|
||||
QgsMapCanvasSnappingUtils( QgsMapCanvas *canvas, QObject *parent = 0 );
|
||||
QgsMapCanvasSnappingUtils( QgsMapCanvas *canvas, QObject *parent = 0, bool asynchronous = false );
|
||||
|
||||
};
|
||||
|
||||
|
@ -937,7 +937,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
|
||||
endProfile();
|
||||
|
||||
startProfile( QStringLiteral( "Snapping utils" ) );
|
||||
mSnappingUtils = new QgsMapCanvasSnappingUtils( mMapCanvas, this );
|
||||
mSnappingUtils = new QgsMapCanvasSnappingUtils( mMapCanvas, this, true );
|
||||
mMapCanvas->setSnappingUtils( mSnappingUtils );
|
||||
connect( QgsProject::instance(), &QgsProject::snappingConfigChanged, mSnappingUtils, &QgsSnappingUtils::setConfig );
|
||||
connect( QgsProject::instance(), &QgsProject::collectAttachedFiles, this, &QgisApp::generateProjectAttachedFiles );
|
||||
|
@ -273,12 +273,6 @@ class CORE_EXPORT QgsSnappingUtils : public QObject
|
||||
|
||||
//! true if we have to build point locator asynchronously
|
||||
bool mAsynchronous = false;
|
||||
|
||||
friend class TestQgsVertexTool;
|
||||
friend class TestQgsMapToolTrimExtendFeature;
|
||||
friend class TestQgsMapToolReshape;
|
||||
friend class TestQgsMapToolAddFeaturePoint;
|
||||
friend class TestQgsMapToolReverseLine;
|
||||
};
|
||||
|
||||
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include <QApplication>
|
||||
#include <QProgressDialog>
|
||||
|
||||
QgsMapCanvasSnappingUtils::QgsMapCanvasSnappingUtils( QgsMapCanvas *canvas, QObject *parent )
|
||||
: QgsSnappingUtils( parent, QgsSettings().value( QStringLiteral( "/qgis/digitizing/snap_invisible_feature" ), false ).toBool(), true )
|
||||
QgsMapCanvasSnappingUtils::QgsMapCanvasSnappingUtils( QgsMapCanvas *canvas, QObject *parent, bool asynchronous )
|
||||
: QgsSnappingUtils( parent, QgsSettings().value( QStringLiteral( "/qgis/digitizing/snap_invisible_feature" ), false ).toBool(), asynchronous )
|
||||
, mCanvas( canvas )
|
||||
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ class GUI_EXPORT QgsMapCanvasSnappingUtils : public QgsSnappingUtils
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QgsMapCanvasSnappingUtils( QgsMapCanvas *canvas, QObject *parent = nullptr );
|
||||
QgsMapCanvasSnappingUtils( QgsMapCanvas *canvas, QObject *parent = nullptr, bool asynchronous = false );
|
||||
|
||||
private slots:
|
||||
void canvasMapSettingsChanged();
|
||||
|
@ -115,7 +115,6 @@ void TestQgsMapToolAddFeaturePoint::initTestCase()
|
||||
cfg.setType( QgsSnappingConfig::VertexAndSegment );
|
||||
cfg.setEnabled( true );
|
||||
mCanvas->snappingUtils()->setConfig( cfg );
|
||||
mCanvas->snappingUtils()->mAsynchronous = false;
|
||||
|
||||
mCanvas->setLayers( QList<QgsMapLayer *>() << mLayerPointZ << mLayerPointZSnap );
|
||||
mCanvas->setCurrentLayer( mLayerPointZ );
|
||||
|
@ -162,7 +162,6 @@ void TestQgsMapToolReshape::initTestCase()
|
||||
cfg.setType( QgsSnappingConfig::VertexAndSegment );
|
||||
cfg.setEnabled( true );
|
||||
mCanvas->snappingUtils()->setConfig( cfg );
|
||||
mCanvas->snappingUtils()->mAsynchronous = false;
|
||||
mCanvas->setLayers( QList<QgsMapLayer *>() << mLayerLineZ << mLayerPointZ << mLayerPolygonZ );
|
||||
mCanvas->setCurrentLayer( mLayerLineZ );
|
||||
|
||||
|
@ -60,7 +60,6 @@ void TestQgsMapToolReverseLine::initTestCase()
|
||||
|
||||
mCanvas = new QgsMapCanvas();
|
||||
mCanvas->setDestinationCrs( QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3946" ) ) );
|
||||
mCanvas->snappingUtils()->mAsynchronous = false;
|
||||
}
|
||||
|
||||
void TestQgsMapToolReverseLine::cleanupTestCase()
|
||||
|
@ -164,7 +164,6 @@ class TestQgsMapToolTrimExtendFeature : public QObject
|
||||
mapSettings.setLayers( QList<QgsMapLayer *>() << vlPolygon.get() << vlMultiLine.get() << vlLineZ.get() << vlTopoEdit.get() << vlTopoLimit.get() );
|
||||
|
||||
QgsSnappingUtils *mSnappingUtils = new QgsMapCanvasSnappingUtils( mCanvas, this );
|
||||
mSnappingUtils->mAsynchronous = false;
|
||||
QgsSnappingConfig snappingConfig = mSnappingUtils->config();
|
||||
mSnappingUtils->setMapSettings( mapSettings );
|
||||
snappingConfig.setEnabled( true );
|
||||
|
@ -248,7 +248,6 @@ void TestQgsVertexTool::initTestCase()
|
||||
mCanvas->setLayers( QList<QgsMapLayer *>() << mLayerLine << mLayerPolygon << mLayerPoint << mLayerLineZ );
|
||||
|
||||
QgsMapCanvasSnappingUtils *snappingUtils = new QgsMapCanvasSnappingUtils( mCanvas, this );
|
||||
snappingUtils->mAsynchronous = false;
|
||||
mCanvas->setSnappingUtils( snappingUtils );
|
||||
|
||||
// create vertex tool
|
||||
|
Loading…
x
Reference in New Issue
Block a user