34 QGridLayout *layout =
new QGridLayout(
this );
35 QLabel *label =
new QLabel( tr(
"The 2.5D renderer only can be used with polygon layers. \n"
36 "'%1' is not a polygon layer and cannot be rendered in 2.5D." )
37 .arg( layer->
name() ),
39 layout->addWidget( label );
44 this->layout()->setContentsMargins( 0, 0, 0, 0 );
46 mAngleWidget->setClearValue( 0 );
47 mWallColorButton->setColorDialogTitle( tr(
"Select Wall Color" ) );
48 mWallColorButton->setAllowOpacity(
true );
49 mWallColorButton->setContext( QStringLiteral(
"symbology" ) );
50 mRoofColorButton->setColorDialogTitle( tr(
"Select Roof Color" ) );
51 mRoofColorButton->setAllowOpacity(
true );
52 mRoofColorButton->setContext( QStringLiteral(
"symbology" ) );
53 mShadowColorButton->setColorDialogTitle( tr(
"Select Shadow Color" ) );
54 mShadowColorButton->setAllowOpacity(
true );
55 mShadowColorButton->setContext( QStringLiteral(
"symbology" ) );
62 mHeightWidget->setLayer( layer );
65 const QVariant height = scope->
variable( QStringLiteral(
"qgis_25d_height" ) );
66 const QVariant angle = scope->
variable( QStringLiteral(
"qgis_25d_angle" ) );
71 mAngleWidget->setClearValue( 70 );
72 mWallColorButton->setColor( mRenderer->wallColor() );
73 mRoofColorButton->setColor( mRenderer->roofColor() );
74 mShadowColorButton->setColor( mRenderer->shadowColor() );
75 mShadowEnabledWidget->setChecked( mRenderer->shadowEnabled() );
76 mShadowSizeWidget->setValue( mRenderer->shadowSpread() );
77 mShadowSizeWidget->setClearValue( 4 );
78 mWallExpositionShading->setChecked( mRenderer->wallShadingEnabled() );
80 connect( mAngleWidget,
static_cast<void ( QSpinBox::* )(
int )
>( &QSpinBox::valueChanged ),
this, &Qgs25DRendererWidget::updateRenderer );
85 connect( mShadowEnabledWidget, &QGroupBox::toggled,
this, &Qgs25DRendererWidget::updateRenderer );
86 connect( mShadowSizeWidget,
static_cast<void ( QDoubleSpinBox::* )(
double )
>( &QDoubleSpinBox::valueChanged ),
this, &Qgs25DRendererWidget::updateRenderer );
87 connect( mWallExpositionShading, &QAbstractButton::toggled,
this, &Qgs25DRendererWidget::updateRenderer );
Single scope for storing variables and functions for use within a QgsExpressionContext.
QVariant variable(const QString &name) const
Retrieves a variable's value from the scope.
static void setLayerVariable(QgsMapLayer *layer, const QString &name, const QVariant &value)
Sets a layer context variable.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.