Merge pull request #67 from xiaoyifang/staged

fix:font family compile error on qt5.15.2
This commit is contained in:
xiaoyifang 2022-05-08 17:24:33 +08:00 committed by GitHub
commit 3efaf8c1e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 );