From 4c48bee7981778937d83b8198719e24083ab9de1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 21 Jul 2022 01:24:36 +0300 Subject: [PATCH 46/46] Qt: Avoid deprecated QFontDatabase constructor in Qt6-mode See osdn #45004 Signed-off-by: Marko Lindqvist --- client/gui-qt/fonts.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/gui-qt/fonts.cpp b/client/gui-qt/fonts.cpp index 83b096a33b..7ce9782a2d 100644 --- a/client/gui-qt/fonts.cpp +++ b/client/gui-qt/fonts.cpp @@ -218,7 +218,9 @@ void configure_fonts() QString configure_font(QString font_name, QStringList sl, int size, bool bold) { +#ifdef FC_QT5_MODE QFontDatabase database; +#endif QString str; QFont *f; QString style; @@ -228,7 +230,11 @@ QString configure_font(QString font_name, QStringList sl, int size, } foreach (str, sl) { +#ifndef FC_QT5_MODE + QList sizes = QFontDatabase::smoothSizes(str, style); +#else // FC_QT5_MODE QList sizes = database.smoothSizes(str, style); +#endif // FC_QT5_MODE if (!sizes.isEmpty()) { QListIterator i(sizes); -- 2.35.1