From 0b352f6a61a12d1db1fbc4563aea50f041b876f7 Mon Sep 17 00:00:00 2001 From: Jonathan Thomas Date: Mon, 31 Aug 2026 16:15:21 -0500 Subject: [PATCH] Support Timer text metrics on Qt 5.9 --- src/effects/Timer.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/effects/Timer.cpp b/src/effects/Timer.cpp index 483d270d9..c3d8a9ff1 100644 --- a/src/effects/Timer.cpp +++ b/src/effects/Timer.cpp @@ -42,6 +42,15 @@ namespace { return GRAVITY_BOTTOM; return gravity; } + + double TextAdvance(const QFontMetricsF& metrics, const QString& text) + { +#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0) + return metrics.horizontalAdvance(text); +#else + return metrics.width(text); +#endif + } } Timer::Timer() : @@ -288,7 +297,7 @@ std::shared_ptr Timer::GetFrame(std::shared_ptr Timer::GetFrame(std::shared_ptr