Created
September 13, 2019 09:06
-
-
Save zas/3c469b122399abda95c424e1b8ee5498 to your computer and use it in GitHub Desktop.
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
from PyQt5.QtCore import QStandardPaths | |
def get_qt_enum(cls, enum): | |
d = {} | |
for key in dir(cls): | |
value = getattr(cls, key) | |
if isinstance(value, enum): | |
d[key] = value | |
return sorted(d, key=lambda k:d[k]) | |
print(get_qt_enum(QStandardPaths, QStandardPaths.StandardLocation)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: