本文整理汇总了C++中QgsVectorLayer::diagramLayerSettings方法的典型用法代码示例。如果您正苦于以下问题:C++ QgsVectorLayer::diagramLayerSettings方法的具体用法?C++ QgsVectorLayer::diagramLayerSettings怎么用?C++ QgsVectorLayer::diagramLayerSettings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QgsVectorLayer
的用法示例。
在下文中一共展示了QgsVectorLayer::diagramLayerSettings方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: diagramMoveable
bool QgsMapToolLabel::diagramMoveable( QgsMapLayer* ml, int& xCol, int& yCol ) const
{
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer*>( ml );
if ( vlayer && vlayer->diagramRenderer() )
{
const QgsDiagramLayerSettings *dls = vlayer->diagramLayerSettings();
if ( dls && dls->xPosColumn >= 0 && dls->yPosColumn >= 0 )
{
xCol = dls->xPosColumn;
yCol = dls->yPosColumn;
return true;
}
}
return false;
}
示例2: diagramCanShowHide
bool QgsMapToolLabel::diagramCanShowHide( QgsMapLayer* ml, int& showCol ) const
{
bool rc = false;
QgsVectorLayer* vlayer = qobject_cast<QgsVectorLayer*>( ml );
if ( vlayer && vlayer->isEditable() && vlayer->diagramsEnabled() )
{
const QgsDiagramLayerSettings *dls = vlayer->diagramLayerSettings();
if ( dls && dls->showColumn >= 0 )
{
showCol = dls->showColumn;
rc = true;
}
}
return rc;
}
示例3: createAuxiliaryFields
bool QgsMapToolLabel::createAuxiliaryFields( LabelDetails &details, QgsDiagramIndexes &indexes )
{
bool newAuxiliaryLayer = false;
QgsVectorLayer *vlayer = details.layer;
if ( !vlayer )
return newAuxiliaryLayer;
if ( !vlayer->auxiliaryLayer() )
{
QgsNewAuxiliaryLayerDialog dlg( vlayer );
dlg.exec();
newAuxiliaryLayer = true;
}
if ( !vlayer->auxiliaryLayer() )
return false;
for ( const QgsDiagramLayerSettings::Property &p : qgis::as_const( mDiagramProperties ) )
{
int index = -1;
// always use the default activated property
QgsProperty prop = vlayer->diagramLayerSettings()->dataDefinedProperties().property( p );
if ( prop.propertyType() == QgsProperty::FieldBasedProperty && prop.isActive() )
{
index = vlayer->fields().lookupField( prop.field() );
}
else
{
index = QgsAuxiliaryLayer::createProperty( p, vlayer );
}
indexes[p] = index;
}
return newAuxiliaryLayer;
}