Skip to content

Commit

Permalink
Add point cloud layer icon in the map layer model
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Feb 7, 2021
1 parent fd56251 commit e82df36
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion python/core/auto_generated/qgsdataitem.sip.in
Expand Up @@ -620,7 +620,7 @@ Returns icon for mesh layer type
%Docstring
Returns icon for vector tile layer
%End
static QIcon iconPointCloudLayer();
static QIcon iconPointCloud();
%Docstring
Returns icon for point cloud layer
%End
Expand Down
2 changes: 1 addition & 1 deletion src/core/layertree/qgslayertreemodel.cpp
Expand Up @@ -213,7 +213,7 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
break;

case QgsMapLayerType::PointCloudLayer:
icon = QgsLayerItem::iconPointCloudLayer();
icon = QgsLayerItem::iconPointCloud();
break;

case QgsMapLayerType::VectorLayer:
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataitem.cpp
Expand Up @@ -106,7 +106,7 @@ QIcon QgsLayerItem::iconVectorTile()
return QgsApplication::getThemeIcon( QStringLiteral( "/mIconVectorTileLayer.svg" ) );
}

QIcon QgsLayerItem::iconPointCloudLayer()
QIcon QgsLayerItem::iconPointCloud()
{
return QgsApplication::getThemeIcon( QStringLiteral( "/mIconPointCloudLayer.svg" ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataitem.h
Expand Up @@ -645,7 +645,7 @@ class CORE_EXPORT QgsLayerItem : public QgsDataItem
//! Returns icon for vector tile layer
static QIcon iconVectorTile();
//! Returns icon for point cloud layer
static QIcon iconPointCloudLayer();
static QIcon iconPointCloud();
//! \returns the layer name
virtual QString layerName() const { return name(); }
};
Expand Down
6 changes: 6 additions & 0 deletions src/core/qgsmaplayermodel.cpp
Expand Up @@ -527,6 +527,11 @@ QIcon QgsMapLayerModel::iconForLayer( QgsMapLayer *layer )
return QgsLayerItem::iconVectorTile();
}

case QgsMapLayerType::PointCloudLayer:
{
return QgsLayerItem::iconPointCloud();
}

case QgsMapLayerType::VectorLayer:
{
QgsVectorLayer *vl = qobject_cast<QgsVectorLayer *>( layer );
Expand Down Expand Up @@ -559,6 +564,7 @@ QIcon QgsMapLayerModel::iconForLayer( QgsMapLayer *layer )
}
}
}

default:
{
return QIcon();
Expand Down

0 comments on commit e82df36

Please sign in to comment.