void QgsPointDisplacementRendererWidget::on_mRendererComboBox_currentIndexChanged( int index ) { QString rendererId = mRendererComboBox->itemData( index ).toString(); QgsRendererV2AbstractMetadata* m = QgsRendererV2Registry::instance()->rendererMetadata( rendererId ); if ( m ) { delete mEmbeddedRendererWidget; mEmbeddedRendererWidget = m->createRendererWidget( mLayer, mStyle, mRenderer->embeddedRenderer()->clone() ); } }
void QgsInvertedPolygonRendererWidget::on_mRendererComboBox_currentIndexChanged( int index ) { QString rendererId = mRendererComboBox->itemData( index ).toString(); QgsRendererV2AbstractMetadata* m = QgsRendererV2Registry::instance()->rendererMetadata( rendererId ); if ( m ) { mEmbeddedRendererWidget.reset( m->createRendererWidget( mLayer, mStyle, const_cast<QgsFeatureRendererV2*>( mRenderer->embeddedRenderer() )->clone() ) ); if ( mLayout->count() > 2 ) { // remove the current renderer widget mLayout->takeAt( 2 ); } mLayout->addWidget( mEmbeddedRendererWidget.data() ); } }