-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Handle conditional visibility of data defined size legend nodes #57461
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
016cfe6
handle conditional visibility of data defined size legend nodes
uclaros 108aa23
tests added
uclaros cb491ea
update test masks
uclaros ac292ac
Merge branch 'master' into fix-50301
uclaros 3bb06c1
add userData property to
uclaros b44b51c
Merge branch 'master' into fix-50301
uclaros 2bc7bc5
don't use deprecated QgsField constructor
uclaros a31dfb5
add mUserData to copy constructor
uclaros File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+1.56 KB
..._defined_size_filter_by_map/expected_legend_data_defined_size_filter_by_map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+724 Bytes
...ned_size_filter_by_map/expected_legend_data_defined_size_filter_by_map_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+19.2 KB
...end_data_defined_size_separated/expected_legend_data_defined_size_separated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+11.1 KB
...ata_defined_size_separated/expected_legend_data_defined_size_separated_mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of the abuse, how about we add a QMap< int, QVariant > userData to QgsLegendSymbolItem, and adapt QgsSymbolLegendNode::data to return those values for unknown roles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could have a new role in
QgsLayerTreeModelLegendNode::CustomRole
for that, instead of handling all unknown roles.But, why a
QMap< int, QVariant >
? What would you store there (in this case and/or in future uses of it)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That also works. I was just thinking ahead if allowing custom roles in QgsLegendSymbolItem would also be useful in future.
The int keys would correspond to a role from QgsLayerTreeModelLegendNode (either public or private). I'd find a QMap approach slightly preferable to having separate members for every property we decide to add in future.