Skip to content
Permalink
Browse files

Expand variable names

  • Loading branch information
nyalldawson committed Nov 16, 2020
1 parent 9aaa708 commit f66ddf4c10dcd3a475f92b4bb3af3522ea4a6414
Showing with 13 additions and 14 deletions.
  1. +13 −14 src/gui/pointcloud/qgspointcloudrendererpropertieswidget.cpp
@@ -27,19 +27,18 @@

static bool _initRenderer( const QString &name, QgsPointCloudRendererWidgetFunc f, const QString &iconName = QString() )
{
QgsPointCloudRendererRegistry *reg = QgsApplication::pointCloudRendererRegistry();
QgsPointCloudRendererAbstractMetadata *am = reg->rendererMetadata( name );
if ( !am )
QgsPointCloudRendererAbstractMetadata *rendererAbstractMetadata = QgsApplication::pointCloudRendererRegistry()->rendererMetadata( name );
if ( !rendererAbstractMetadata )
return false;
QgsPointCloudRendererMetadata *m = dynamic_cast<QgsPointCloudRendererMetadata *>( am );
if ( !m )
QgsPointCloudRendererMetadata *rendererMetadata = dynamic_cast<QgsPointCloudRendererMetadata *>( rendererAbstractMetadata );
if ( !rendererMetadata )
return false;

m->setWidgetFunction( f );
rendererMetadata->setWidgetFunction( f );

if ( !iconName.isEmpty() )
{
m->setIcon( QgsApplication::getThemeIcon( iconName ) );
rendererMetadata->setIcon( QgsApplication::getThemeIcon( iconName ) );
}

QgsDebugMsgLevel( "Set for " + name, 2 );
@@ -177,16 +176,16 @@ void QgsPointCloudRendererPropertiesWidget::rendererChanged()
mActiveWidget = nullptr;
}

QgsPointCloudRendererWidget *w = nullptr;
QgsPointCloudRendererAbstractMetadata *m = QgsApplication::pointCloudRendererRegistry()->rendererMetadata( rendererName );
if ( m )
w = m->createRendererWidget( mLayer, mStyle, oldRenderer.get() );
QgsPointCloudRendererWidget *widget = nullptr;
QgsPointCloudRendererAbstractMetadata *rendererMetadata = QgsApplication::pointCloudRendererRegistry()->rendererMetadata( rendererName );
if ( rendererMetadata )
widget = rendererMetadata->createRendererWidget( mLayer, mStyle, oldRenderer.get() );
oldRenderer.reset();

if ( w )
if ( widget )
{
// instantiate the widget and set as active
mActiveWidget = w;
mActiveWidget = widget;
stackedWidget->addWidget( mActiveWidget );
stackedWidget->setCurrentWidget( mActiveWidget );
if ( mActiveWidget->renderer() )
@@ -201,7 +200,7 @@ void QgsPointCloudRendererPropertiesWidget::rendererChanged()
}
connect( mActiveWidget, &QgsPanelWidget::widgetChanged, this, &QgsPointCloudRendererPropertiesWidget::widgetChanged );
connect( mActiveWidget, &QgsPanelWidget::showPanel, this, &QgsPointCloudRendererPropertiesWidget::openPanel );
w->setDockMode( dockMode() );
widget->setDockMode( dockMode() );
}
else
{

0 comments on commit f66ddf4

Please sign in to comment.
You can’t perform that action at this time.