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

Is there a need for enumasint or intasenum? #356

Open
zjp opened this issue Jul 19, 2022 · 3 comments · May be fixed by #481
Open

Is there a need for enumasint or intasenum? #356

zjp opened this issue Jul 19, 2022 · 3 comments · May be fixed by #481

Comments

@zjp
Copy link
Contributor

zjp commented Jul 19, 2022

One thing we've done in ChimeraX is standardize on using integers instead of enum values as they exist in PyQt6 which poses a challenge because we're still thinking about whether we want to use that or PySide6.

We have two utility functions, qt_enum_as_int and qt_int_as_enum, to help us achieve the flexibility we need. For other packages (PyQt5, pyside2, pyside6) that don't use enums, we test whether the input is a subclass of enum.Enum and return the input if it isn't.

Does that sound like something that would be useful in compat.py?

@dalthviz
Copy link
Member

Hi @zjp thanks for sharing! I would say it make sense to me to have some way to achieve compatibility between things. Just in case, what do you think @ccordoba12 @CAM-Gerlach ?

@ccordoba12
Copy link
Member

Sounds good to me too.

@dalthviz dalthviz added this to the v2.2.0 milestone Jul 21, 2022
@CAM-Gerlach
Copy link
Member

Sounds good to me to have the conversion functions in the qtpy.compat module, though we could consider also shimming over the actual differences if that's not already done and its straightforward to do (by changes in QtPy rather than monkeypatching the original packages).

@dalthviz dalthviz modified the milestones: v2.2.0, v2.2.1 Aug 1, 2022
@dalthviz dalthviz modified the milestones: v2.2.1, v2.3.0 Sep 23, 2022
@dalthviz dalthviz modified the milestones: v2.4.0, v2.4.1 Aug 11, 2023
@dalthviz dalthviz modified the milestones: v2.4.1, v2.5.0 Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants