Skip to content
Permalink
Browse files

avoid CRS in the tooltip when the layer is not spatial

  • Loading branch information
Gustry authored and nyalldawson committed Aug 8, 2018
1 parent f145631 commit d90348df403fbb13d50190ddb2f9664c43f156a3
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/layertree/qgslayertreemodel.cpp
  2. +1 −1 src/core/qgsmaplayermodel.cpp
@@ -287,7 +287,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const

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

if ( layer->crs().isValid() )
if ( layer->isSpatial() && layer->crs().isValid() )
{
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
title += tr( " (%1 - %2)" ).arg( QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() ).toHtmlEscaped();
@@ -290,7 +290,7 @@ QVariant QgsMapLayerModel::data( const QModelIndex &index, int role ) const
if ( title.isEmpty() )
title = layer->name();
title = "<b>" + title + "</b>";
if ( layer->crs().isValid() )
if ( layer->isSpatial() && layer->crs().isValid() )
{
if ( QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer ) )
title = tr( "%1 (%2 - %3)" ).arg( title, QgsWkbTypes::displayString( vl->wkbType() ), layer->crs().authid() );

0 comments on commit d90348d

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