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

Default-states dictionary and other properties of widgets conventions #105

Closed
DanicaSTFC opened this issue Nov 17, 2023 · 2 comments · Fixed by #109
Closed

Default-states dictionary and other properties of widgets conventions #105

DanicaSTFC opened this issue Nov 17, 2023 · 2 comments · Fixed by #109
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@DanicaSTFC
Copy link
Collaborator

DanicaSTFC commented Nov 17, 2023

From @lauramurgatroyd

I think we need to think carefully about this dictionary. Firstly, we know we want to store other things about widgets in later PRs, including their widget number #95. Therefore I would consider whether a 'widget_properties' dictionary could be a better plan, structured something like:
self.widget_properties = { 'widget_name': {'default': , 'widget_number': }, .... }
(or with some snappier/better name for widget_number)
and could include other information as we think of it, that could be useful.

Then the 'default' section of that dict would hold a dictionary that contains the default state:

eqt/eqt/ui/UIFormWidget.py

Lines 170 to 173 in ec2c5a1

Format: {'widget_name': {'value': str | bool | int, 'enabled': bool, 'visible': bool},
...},
e.g. {{'widget1': {'value': 1, 'enabled': True, 'visible': True},
'widget2': {'value': 2, 'enabled': False, 'visible': False}}.

Originally posted by @lauramurgatroyd in #97 (comment)

#97 (comment)

@DanicaSTFC and I discussed the benefits of separating the default state from the widget number, and store them in different places.
This would include being able to take one widget with its defaults and add to a different form easily without bringing across also widget position.

@DanicaSTFC
Copy link
Collaborator Author

This issue could be solved together with #108 (comment)

@DanicaSTFC
Copy link
Collaborator Author

We will include the widget number in the dictionary (for both states and default states) in this PR

@DanicaSTFC DanicaSTFC changed the title Default states dictionary and other properties of widgets conventions Default-states dictionary and other properties of widgets conventions Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants