mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +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"));
|
QString defName(L_S(STR_PAGE_DLG, S_ID(IDS_DLG_DEFAULT_FONT), "Default"));
|
||||||
box->addItem(defName);
|
box->addItem(defName);
|
||||||
|
|
||||||
QFontDatabase fDataBase;
|
if (_font_name_list.size() == 0)
|
||||||
for (QString family : fDataBase.families()) {
|
{
|
||||||
|
QFontDatabase fDataBase;
|
||||||
|
_font_name_list = fDataBase.families();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (QString family : _font_name_list) {
|
||||||
if (family.indexOf("[") == -1)
|
if (family.indexOf("[") == -1)
|
||||||
{
|
{
|
||||||
box->addItem(family);
|
box->addItem(family);
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QStringList>
|
||||||
|
|
||||||
class QComboBox;
|
class QComboBox;
|
||||||
|
|
||||||
@ -57,7 +58,9 @@ namespace pv
|
|||||||
void bind_font_name_list(QComboBox *box, QString v);
|
void bind_font_name_list(QComboBox *box, QString v);
|
||||||
|
|
||||||
void bind_font_size_list(QComboBox *box, float size);
|
void bind_font_size_list(QComboBox *box, float size);
|
||||||
|
|
||||||
|
private:
|
||||||
|
QStringList _font_name_list;
|
||||||
};
|
};
|
||||||
|
|
||||||
}//
|
}//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user