Skip to content

Commit 0a2948a

Browse files
committed
only consider the crs of layers with geometry for automatically setting of project crs and otfr (fixes #10510)
1 parent 9bbefef commit 0a2948a

File tree

4 files changed

+106
-5
lines changed

4 files changed

+106
-5
lines changed

src/app/qgisapp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -459,8 +459,8 @@ void QgisApp::validateSrs( QgsCoordinateReferenceSystem &srs )
459459
QString myDefaultProjectionOption = mySettings.value( "/Projections/defaultBehaviour", "prompt" ).toString();
460460
if ( myDefaultProjectionOption == "prompt" )
461461
{
462-
//@note this class is not a descendent of QWidget so we cant pass
463-
//it in the ctor of the layer projection selector
462+
// @note this class is not a descendent of QWidget so we can't pass
463+
// it in the ctor of the layer projection selector
464464

465465
QgsGenericProjectionSelector *mySelector = new QgsGenericProjectionSelector();
466466
mySelector->setMessage( srs.validationHint() ); //shows a generic message, if not specified

src/core/composer/qgscomposition.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
214214

215215
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to guides
216216
* and the edges and centers of other items.
217-
* @param t snap tolerance in pixels
217+
* @param snapTolerance snap tolerance in pixels
218218
* @see alignmentSnapTolerance
219219
* @note Added in QGIS 2.5
220220
*/

src/gui/layertree/qgslayertreemapcanvasbridge.cpp

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "qgslayertree.h"
1919
#include "qgslayertreeutils.h"
2020
#include "qgsmaplayer.h"
21-
21+
#include "qgsvectorlayer.h"
2222
#include "qgsmapcanvas.h"
2323

2424
QgsLayerTreeMapCanvasBridge::QgsLayerTreeMapCanvasBridge( QgsLayerTreeGroup *root, QgsMapCanvas *canvas, QObject* parent )
@@ -123,7 +123,12 @@ void QgsLayerTreeMapCanvasBridge::setCanvasLayers()
123123
{
124124
foreach ( QgsLayerTreeLayer* layerNode, layerNodes )
125125
{
126-
if ( layerNode->layer() )
126+
if ( layerNode->layer() &&
127+
(
128+
qobject_cast<QgsVectorLayer *>( layerNode->layer() ) == 0 ||
129+
qobject_cast<QgsVectorLayer *>( layerNode->layer() )->geometryType() != QGis::NoGeometry
130+
)
131+
)
127132
{
128133
mCanvas->setDestinationCrs( layerNode->layer()->crs() );
129134
mCanvas->setMapUnits( layerNode->layer()->crs().mapUnits() );

src/ui/qgsoptionsbase.ui

+96
Original file line numberDiff line numberDiff line change
@@ -4633,5 +4633,101 @@
46334633
</hint>
46344634
</hints>
46354635
</connection>
4636+
<connection>
4637+
<sender>radUseGlobalProjection</sender>
4638+
<signal>toggled(bool)</signal>
4639+
<receiver>leLayerGlobalCrs</receiver>
4640+
<slot>setEnabled(bool)</slot>
4641+
<hints>
4642+
<hint type="sourcelabel">
4643+
<x>310</x>
4644+
<y>285</y>
4645+
</hint>
4646+
<hint type="destinationlabel">
4647+
<x>644</x>
4648+
<y>312</y>
4649+
</hint>
4650+
</hints>
4651+
</connection>
4652+
<connection>
4653+
<sender>radUseGlobalProjection</sender>
4654+
<signal>toggled(bool)</signal>
4655+
<receiver>pbnSelectProjection</receiver>
4656+
<slot>setEnabled(bool)</slot>
4657+
<hints>
4658+
<hint type="sourcelabel">
4659+
<x>345</x>
4660+
<y>287</y>
4661+
</hint>
4662+
<hint type="destinationlabel">
4663+
<x>717</x>
4664+
<y>303</y>
4665+
</hint>
4666+
</hints>
4667+
</connection>
4668+
<connection>
4669+
<sender>radUseProjectProjection</sender>
4670+
<signal>toggled(bool)</signal>
4671+
<receiver>leLayerGlobalCrs</receiver>
4672+
<slot>setDisabled(bool)</slot>
4673+
<hints>
4674+
<hint type="sourcelabel">
4675+
<x>310</x>
4676+
<y>285</y>
4677+
</hint>
4678+
<hint type="destinationlabel">
4679+
<x>644</x>
4680+
<y>312</y>
4681+
</hint>
4682+
</hints>
4683+
</connection>
4684+
<connection>
4685+
<sender>radUseProjectProjection</sender>
4686+
<signal>toggled(bool)</signal>
4687+
<receiver>pbnSelectProjection</receiver>
4688+
<slot>setDisabled(bool)</slot>
4689+
<hints>
4690+
<hint type="sourcelabel">
4691+
<x>345</x>
4692+
<y>287</y>
4693+
</hint>
4694+
<hint type="destinationlabel">
4695+
<x>717</x>
4696+
<y>303</y>
4697+
</hint>
4698+
</hints>
4699+
</connection>
4700+
<connection>
4701+
<sender>radPromptForProjection</sender>
4702+
<signal>toggled(bool)</signal>
4703+
<receiver>leLayerGlobalCrs</receiver>
4704+
<slot>setDisabled(bool)</slot>
4705+
<hints>
4706+
<hint type="sourcelabel">
4707+
<x>310</x>
4708+
<y>285</y>
4709+
</hint>
4710+
<hint type="destinationlabel">
4711+
<x>644</x>
4712+
<y>312</y>
4713+
</hint>
4714+
</hints>
4715+
</connection>
4716+
<connection>
4717+
<sender>radPromptForProjection</sender>
4718+
<signal>toggled(bool)</signal>
4719+
<receiver>pbnSelectProjection</receiver>
4720+
<slot>setDisabled(bool)</slot>
4721+
<hints>
4722+
<hint type="sourcelabel">
4723+
<x>345</x>
4724+
<y>287</y>
4725+
</hint>
4726+
<hint type="destinationlabel">
4727+
<x>717</x>
4728+
<y>303</y>
4729+
</hint>
4730+
</hints>
4731+
</connection>
46364732
</connections>
46374733
</ui>

0 commit comments

Comments
 (0)