fix:font family compile error on qt5.15.2

This commit is contained in:
Xiao YiFang 2022-05-08 17:10:35 +08:00
parent 9d10ca5c2f
commit 368724dde3

View file

@ -94,8 +94,12 @@ Preferences::Preferences( QWidget * parent, Config::Class & cfg_ ):
prevInterfaceLanguage = x; prevInterfaceLanguage = x;
break; break;
} }
#if( QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 ) )
const QStringList fontFamilies = QFontDatabase::families(); const QStringList fontFamilies = QFontDatabase::families();
#else
QFontDatabase fontDb;
const QStringList fontFamilies = fontDb.families();
#endif
for( const QString & family : fontFamilies ) for( const QString & family : fontFamilies )
{ {
ui.fontFamilies->addItem( family ); ui.fontFamilies->addItem( family );