Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gui][processing] Fix inconsistent behavior with the map layer widget's selected features only checkbox #60197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Jan 21, 2025

Description

This PR fixes #60108 whereas the processing map layer parameter widget's [x] selected features only checkbox was behaving inconsistently and would sporadically fail to reflect the selection state of the active layer assigned to the map layer combobox when opening an alg. dialog.

There are two fixes in there:

  • due to an issue with layer changed signal with the map layer combo box (more on that later), when we call QgsProcessingMapLayerComboBox::setLayer , we block the combo box signal and manually trigger the onLayerChanged slot.
  • one issue I spotted while profiling this was that we were needlessly rebuilding the map layers model at least once per map layer parameter as setting the widget context's project to the map layer combo box was triggering a model reset, this has been fixed by skipping model reset when the project being set == old project.

Now, there's still an issue with the map layer combobox whereas the combobox will emit a layerChanged( nullptr ) when a model's project has changed and is removing all of its layers, whereas it won't re-emit a signal when the model has reloaded since we are adding more than one row and the rowsChanged count will be greater than 0.

The problematic logic is here: https://github.com/qgis/QGIS/blob/master/src/gui/qgsmaplayercombobox.cpp#L156-L167

Since the two patches above fix processing's algorithm dialog, I'm inclined not to touch the map layer combobox logic as it's used in a lot of other places.

@github-actions github-actions bot added this to the 3.42.0 milestone Jan 21, 2025
Copy link

github-actions bot commented Jan 21, 2025

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit fc958b5)

🪟 Windows Qt6 builds

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant