QgsSymbol *QgsGraduatedSymbolRenderer::originalSymbolForFeature( QgsFeature &feature, QgsRenderContext &context ) { QVariant value = valueForFeature( feature, context ); // Null values should not be categorized if ( value.isNull() ) return nullptr; // find the right category return symbolForValue( value.toDouble() ); }
QgsSymbolV2* QgsCategorizedSymbolRendererV2::originalSymbolForFeature( QgsFeature& feature, QgsRenderContext &context ) { QVariant value = valueForFeature( feature, context ); // find the right symbol for the category QgsSymbolV2 *symbol = symbolForValue( value ); if ( symbol == skipRender() ) return nullptr; if ( !symbol ) { // if no symbol found use default one return symbolForValue( QVariant( "" ) ); } return symbol; }