Load the font name list one time

This commit is contained in:
dreamsourcelabTAI 2023-06-09 15:05:32 +08:00
parent 6468461d6c
commit 7ff36f55c7
2 changed files with 11 additions and 3 deletions

View File

@ -59,8 +59,13 @@ void ApplicationParamDlg::bind_font_name_list(QComboBox *box, QString v)
QString defName(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DEFAULT_FONT), "Default"));
box->addItem(defName);
if (_font_name_list.size() == 0)
{
QFontDatabase fDataBase;
for (QString family : fDataBase.families()) {
_font_name_list = fDataBase.families();
}
for (QString family : _font_name_list) {
if (family.indexOf("[") == -1)
{
box->addItem(family);

View File

@ -23,6 +23,7 @@
#include <QObject>
#include <QWidget>
#include <QStringList>
class QComboBox;
@ -58,6 +59,8 @@ namespace pv
void bind_font_size_list(QComboBox *box, float size);
private:
QStringList _font_name_list;
};
}//