Skip to content

Commit 1c51d69

Browse files
Gustrynyalldawson
authored andcommitted
avoid CRS in the tooltip when the layer is not spatial
(cherry-picked from d90348d)
1 parent c6bb3cd commit 1c51d69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/core/layertree/qgslayertreemodel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
287287

288288
title = "<b>" + title.toHtmlEscaped() + "</b>";
289289

290-
if ( layer->crs().isValid() )
290+
if ( layer->isSpatial() && layer->crs().isValid() )
291291
{
292292
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
293293
title += tr( " (%1 - %2)" ).arg( QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() ).toHtmlEscaped();

src/core/qgsmaplayermodel.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
290290
if ( title.isEmpty() )
291291
title = layer->name();
292292
title = "<b>" + title + "</b>";
293-
if ( layer->crs().isValid() )
293+
if ( layer->isSpatial() && layer->crs().isValid() )
294294
{
295295
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
296296
title = tr( "%1 (%2 - %3)" ).arg( title, QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() );

0 commit comments

Comments
 (0)