Skip to content

Commit

Permalink
[layertree] Do not show check box for nonspatial tables
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed May 22, 2014
1 parent 6f5c775 commit fab44c7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/gui/layertree/qgslayertreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,11 @@ QVariant QgsLayerTreeModel::data( const QModelIndex &index, int role ) const
if ( QgsLayerTree::isLayer( node ) )
{
QgsLayerTreeLayer* nodeLayer = QgsLayerTree::toLayer( node );
if ( nodeLayer->layer() && nodeLayer->layer()->type() == QgsMapLayer::VectorLayer )
{
if ( qobject_cast<QgsVectorLayer*>( nodeLayer->layer() )->geometryType() == QGis::NoGeometry )
return QVariant(); // do not show checkbox for non-spatial tables
}
return nodeLayer->isVisible();
}
else if ( QgsLayerTree::isGroup( node ) )
Expand Down

0 comments on commit fab44c7

Please sign in to comment.