From 368724dde30a25980ae463cc2417307a466d3682 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sun, 8 May 2022 17:10:35 +0800 Subject: [PATCH] fix:font family compile error on qt5.15.2 --- preferences.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/preferences.cc b/preferences.cc index 63839dd4..0ef9dd52 100644 --- a/preferences.cc +++ b/preferences.cc @@ -94,8 +94,12 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ): prevInterfaceLanguage = x; break; } - +#if( QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) ) const QStringList fontFamilies = QFontDatabase::families(); +#else + QFontDatabase fontDb; + const QStringList fontFamilies = fontDb.families(); +#endif for( const QString & family : fontFamilies ) { ui.fontFamilies->addItem( family );