Skip to content

Restore expanded state persistence for custom class properties#4493

Open
Oval17 wants to merge 1 commit intomapeditor:masterfrom
Oval17:fix/4035-restore-expanded-properties-persistence
Open

Restore expanded state persistence for custom class properties#4493
Oval17 wants to merge 1 commit intomapeditor:masterfrom
Oval17:fix/4035-restore-expanded-properties-persistence

Conversation

@Oval17
Copy link
Copy Markdown
Contributor

@Oval17 Oval17 commented Apr 3, 2026

Hi @bjorn @joereynolds

This PR Fixes #4035

I have changed, verified and tested the following things

  1. setupExpandedStateis called when a new class GroupProperty is created
  2. It reads initial state from mExpandedProperties (empty set → defaults to collapsed, matching the maintainer's requirement)
  3. Connects expandedChanged to update the set reactively
  4. Recurses into nested class properties using path-based keys (e.g., ["ClassName", "SubclassName"])
  5. Qt's 4-arg connect with this as context handles cleanup automatically

Ready for inputs and Review.
Thanks

The mExpandedProperties field was declared in VariantMapProperty but
never used after the list-properties refactoring in mapeditor#4002. This restores
the logic: class properties start collapsed and the user's expand/collapse
choices are remembered within the session. When properties are recreated
(e.g. due to type changes or object switching), the expanded state is
restored from the in-memory set.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow collapsing/expanding of custom properties en-masse

1 participant