本文整理汇总了C++中QgsVectorLayer::isUsingRendererV2方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsVectorLayer::isUsingRendererV2方法的具体用法?C++ QgsVectorLayer::isUsingRendererV2怎么用?C++ QgsVectorLayer::isUsingRendererV2使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsVectorLayer
的用法示例。
在下文中一共展示了QgsVectorLayer::isUsingRendererV2方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateLayer
void QgsLegendModel::updateLayer( QStandardItem* layerItem )
{
QgsDebugMsg( "Entered." );
QgsComposerLayerItem* lItem = dynamic_cast<QgsComposerLayerItem*>( layerItem );
if ( lItem )
{
QgsMapLayer* mapLayer = QgsMapLayerRegistry::instance()->mapLayer( lItem->layerID() );
if ( mapLayer )
{
//delete all the entries under layer item
int currentRowCount = lItem->rowCount();
for ( int i = currentRowCount - 1; i >= 0; --i )
{
lItem->removeRow( i );
}
QgsVectorLayer* vLayer = qobject_cast<QgsVectorLayer*>( mapLayer );
//set layer name as item text
QString label = mapLayer->name();
if ( vLayer && lItem->showFeatureCount() )
{
label += QString( " [%1]" ).arg( vLayer->featureCount() );
}
layerItem->setText( label );
if ( vLayer )
{
if ( vLayer->isUsingRendererV2() )
{
addVectorLayerItemsV2( lItem, vLayer );
}
else
{
addVectorLayerItems( lItem, vLayer );
}
}
QgsRasterLayer* rLayer = qobject_cast<QgsRasterLayer*>( mapLayer );
if ( rLayer )
{
addRasterLayerItems( lItem, rLayer );
}
}
}
}
示例2: refreshSymbology
void QgsLegendLayer::refreshSymbology( const QString& key, double widthScale )
{
QgsMapLayer* theMapLayer = QgsMapLayerRegistry::instance()->mapLayer( key );
if ( !theMapLayer )
{
return;
}
if ( theMapLayer->type() == QgsMapLayer::VectorLayer ) // VECTOR
{
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer *>( theMapLayer );
if ( vlayer->isUsingRendererV2() )
vectorLayerSymbologyV2( vlayer );
else
vectorLayerSymbology( vlayer, widthScale ); // get and change symbology
}
else if ( theMapLayer->type() == QgsMapLayer::RasterLayer ) // RASTER
{
QgsRasterLayer* rlayer = qobject_cast<QgsRasterLayer *>( theMapLayer );
rasterLayerSymbology( rlayer ); // get and change symbology
}
updateIcon();
}