diff --git a/src/3d/qgs3dutils.cpp b/src/3d/qgs3dutils.cpp index ab89cdc70102..3218b327f3c8 100644 --- a/src/3d/qgs3dutils.cpp +++ b/src/3d/qgs3dutils.cpp @@ -490,7 +490,7 @@ void Qgs3DUtils::extractPointPositions( const QgsFeature &f, const Qgs3DRenderCo { geomZ = pt.z(); } - const float terrainZ = context.terrainRenderingEnabled() && context.terrainGenerator() ? context.terrainGenerator()->heightAt( pt.x(), pt.y(), context ) * context.terrainSettings()->verticalScale() : 0; + const float terrainZ = context.terrainRenderingEnabled() && context.terrainGenerator() ? static_cast( context.terrainGenerator()->heightAt( pt.x(), pt.y(), context ) * context.terrainSettings()->verticalScale() ) : 0.f; float h = 0.0f; switch ( altClamp ) { diff --git a/src/3d/qgsrulebasedchunkloader_p.cpp b/src/3d/qgsrulebasedchunkloader_p.cpp index c28601603789..fecb7297e771 100644 --- a/src/3d/qgsrulebasedchunkloader_p.cpp +++ b/src/3d/qgsrulebasedchunkloader_p.cpp @@ -196,7 +196,7 @@ QgsRuleBasedChunkedEntity::QgsRuleBasedChunkedEntity( Qgs3DMapSettings *map, Qgs mTransform = new Qt3DCore::QTransform; if ( applyTerrainOffset() ) { - mTransform->setTranslation( QVector3D( 0.0f, map->terrainSettings()->elevationOffset(), 0.0f ) ); + mTransform->setTranslation( QVector3D( 0.0f, static_cast( map->terrainSettings()->elevationOffset() ), 0.0f ) ); } this->addComponent( mTransform ); connect( map, &Qgs3DMapSettings::terrainSettingsChanged, this, &QgsRuleBasedChunkedEntity::onTerrainElevationOffsetChanged ); @@ -256,8 +256,8 @@ bool QgsRuleBasedChunkedEntity::applyTerrainOffset() const void QgsRuleBasedChunkedEntity::onTerrainElevationOffsetChanged() { - float previousOffset = mTransform->translation()[1]; - float newOffset = qobject_cast( sender() )->terrainSettings()->elevationOffset(); + const float previousOffset = mTransform->translation()[1]; + float newOffset = static_cast( qobject_cast( sender() )->terrainSettings()->elevationOffset() ); if ( !applyTerrainOffset() ) { newOffset = 0.0; diff --git a/src/3d/qgsvectorlayerchunkloader_p.cpp b/src/3d/qgsvectorlayerchunkloader_p.cpp index d6f5c85d75e4..51fb7752c3d3 100644 --- a/src/3d/qgsvectorlayerchunkloader_p.cpp +++ b/src/3d/qgsvectorlayerchunkloader_p.cpp @@ -192,7 +192,7 @@ QgsVectorLayerChunkedEntity::QgsVectorLayerChunkedEntity( Qgs3DMapSettings *map, mTransform = new Qt3DCore::QTransform; if ( applyTerrainOffset() ) { - mTransform->setTranslation( QVector3D( 0.0f, map->terrainSettings()->elevationOffset(), 0.0f ) ); + mTransform->setTranslation( QVector3D( 0.0f, static_cast( map->terrainSettings()->elevationOffset() ), 0.0f ) ); } this->addComponent( mTransform ); @@ -250,7 +250,7 @@ bool QgsVectorLayerChunkedEntity::applyTerrainOffset() const void QgsVectorLayerChunkedEntity::onTerrainElevationOffsetChanged() { QgsDebugMsgLevel( QStringLiteral( "QgsVectorLayerChunkedEntity::onTerrainElevationOffsetChanged" ), 2 ); - float newOffset = qobject_cast( sender() )->terrainSettings()->elevationOffset(); + float newOffset = static_cast( qobject_cast( sender() )->terrainSettings()->elevationOffset() ); if ( !applyTerrainOffset() ) { newOffset = 0.0;