From 7ed9c506d6285ec5e6367a506c262233afb53e31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Thu, 20 Jun 2024 01:05:43 +0800 Subject: [PATCH] qt6 --- .../LunaTranslator/rendertext/internal/webview/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/rendertext/internal/webview/base.py b/LunaTranslator/LunaTranslator/rendertext/internal/webview/base.py index e3b3009a..62331529 100644 --- a/LunaTranslator/LunaTranslator/rendertext/internal/webview/base.py +++ b/LunaTranslator/LunaTranslator/rendertext/internal/webview/base.py @@ -41,7 +41,9 @@ class base: self.webview.bind(name, func) def measureH(self, font_family, font_size): - font = QFont(font_family, font_size) + font = QFont() + font.setFamily(font_family) + font.setPointSizeF(font_size) fmetrics = QFontMetrics(font) return fmetrics.height()