Skip to content

QgsTerrainEntity: remove whole terrain reload when 3D symbols are updated#65715

Open
benoitdm-oslandia wants to merge 7 commits intoqgis:masterfrom
benoitdm-oslandia:fix/terrain_reload
Open

QgsTerrainEntity: remove whole terrain reload when 3D symbols are updated#65715
benoitdm-oslandia wants to merge 7 commits intoqgis:masterfrom
benoitdm-oslandia:fix/terrain_reload

Conversation

@benoitdm-oslandia
Copy link
Copy Markdown
Collaborator

Currently, whenever a user opens the 3D style panel, enables the automatic update checkbox, and modifies settings unrelated to terrain, QGIS deletes and redraws all terrain entities. This PR removes the link between layer changes and terrain reloading.

@benoitdm-oslandia benoitdm-oslandia self-assigned this Apr 7, 2026
@benoitdm-oslandia benoitdm-oslandia added the 3D Relates to QGIS' 3D engine or rendering label Apr 7, 2026
@github-actions github-actions Bot added this to the 4.2.0 milestone Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 7, 2026

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit bc44276)

🍎 MacOS Qt6 builds

Download MacOS Qt6 builds of this PR for testing.
This app is not notarized, run sudo xattr -d com.apple.quarantine /Applications/QGIS*.app to avoid the warning
(Built from commit bc44276)

Comment thread src/3d/terrain/qgsterrainentity.cpp
Comment thread src/3d/terrain/qgsterrainentity.cpp
Comment thread src/3d/terrain/qgsterrainentity.cpp Outdated
Comment thread src/3d/terrain/qgsterrainentity.cpp Outdated
Comment on lines +225 to +226
connect( layer, &QgsMapLayer::styleChanged, this, &QgsTerrainEntity::onLayerStyleOrFeatureChanged );
connect( layer, &QgsMapLayer::repaintRequested, this, &QgsTerrainEntity::onLayerStyleOrFeatureChanged );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are both repaintRequested and styleChanged needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems right to me as styleChanged and repaintRequested look like they are not part of the same workflow. The slot/signal workflow looks a bit messy to me, I may be wrong!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the case where styleChanged is emitted but repaintRequested is not?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nyalldawson @uclaros I keep only repaintRequested?

Comment thread src/3d/terrain/qgsterrainentity.h Outdated
@uclaros
Copy link
Copy Markdown
Contributor

uclaros commented Apr 23, 2026

The same logic is used for globe chunked entity and map overlay entity. Should these not be updated to have matching logic?

@benoitdm-oslandia
Copy link
Copy Markdown
Collaborator Author

The same logic is used for globe chunked entity and map overlay entity. Should these not be updated to have matching logic?

Can you point out the code please?

@uclaros
Copy link
Copy Markdown
Contributor

uclaros commented Apr 23, 2026

void QgsGlobeEntity::onLayersChanged()
{
connectToLayersRepaintRequest();
invalidateMapImages();
}

and
void QgsMapOverlayEntity::onLayersChanged()
{
connectToLayersRepaintRequest();
invalidateMapImage();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3D Relates to QGIS' 3D engine or rendering

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants