Skip to content

Commit

Permalink
fix: to_string fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phil65 committed Oct 15, 2024
1 parent fe58357 commit dbd2c80
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions prettyqt/utils/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,14 @@ def to_string(val: Any, locale: QtCore.QLocale | None = None) -> str:
case bool():
return "✓" if val else "☐"
case enum.Flag():
return val.name
return val.name or ""
case enum.Enum():
return val.name
case int() | float() | core.QByteArray():
case int() | float():
return locale.toString(val)
# case core.QByteArray():
# data = val.data()
# return locale.toString(data)
case gui.QColor():
return f"({val.red()},{val.green()},{val.blue()},{val.alpha()})"
case gui.QBrush():
Expand Down

0 comments on commit dbd2c80

Please sign in to comment.