From dbd2c8080d8f21eea0287fadc5d97304308aaf73 Mon Sep 17 00:00:00 2001 From: phil65 Date: Tue, 15 Oct 2024 23:09:25 +0200 Subject: [PATCH] fix: to_string fixes --- prettyqt/utils/datatypes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/prettyqt/utils/datatypes.py b/prettyqt/utils/datatypes.py index 172a48368..0fb66154b 100644 --- a/prettyqt/utils/datatypes.py +++ b/prettyqt/utils/datatypes.py @@ -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():