summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2024-01-11 17:20:06 -0500
committerGlenn Smith <glenn@vector35.com>2024-01-12 14:39:54 -0500
commit8650691983556336705759325037086143587037 (patch)
tree274bd83851fdc4636aa412db34f3b39099230299
parent2b7ccb218c08d091216fee539938f8df29ff9324 (diff)
Add fmt::format for QString
-rw-r--r--ui/util.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/util.h b/ui/util.h
index e6b6fdb2..a49fc007 100644
--- a/ui/util.h
+++ b/ui/util.h
@@ -44,6 +44,15 @@ namespace fmt
}
}
+template<> struct fmt::formatter<QString>
+{
+ format_context::iterator format(const QString& obj, format_context& ctx) const
+ {
+ return fmt::format_to(ctx.out(), "{}", obj.toStdString());
+ }
+ constexpr auto parse(format_parse_context& ctx) -> format_parse_context::iterator { return ctx.begin(); }
+};
+
/*!
@}
*/