mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-13 13:32:53 +08:00
Load the font name list one time
This commit is contained in:
parent
6468461d6c
commit
7ff36f55c7
@ -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);
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
}//
|
||||
|
Loading…
x
Reference in New Issue
Block a user