-
Notifications
You must be signed in to change notification settings - Fork 18
/
CFontProperty.h
54 lines (38 loc) · 1.51 KB
/
CFontProperty.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef CFONTPROPERTY_H
#define CFONTPROPERTY_H
#include "CBaseProperty.h"
#include "CButtonBasedEditor.h"
#include <QFontComboBox>
class CFontProperty : public CBaseProperty
{
public:
CFontProperty(const QByteArray& id, const QString &name, const QFont& font,
const QFontComboBox::FontFilters filters = QFontComboBox::AllFonts,
const QFontDatabase::WritingSystem writeSystem = QFontDatabase::Any);
CFontProperty(CBaseProperty *top, const QByteArray& id, const QString &name, const QFont& font,
const QFontComboBox::FontFilters filters = QFontComboBox::AllFonts,
const QFontDatabase::WritingSystem writeSystem = QFontDatabase::Any);
void setFont(const QFont& font);
const QFont& getFont() const;
// reimp
virtual QVariant getVariantValue() const;
virtual void displayValue();
virtual QWidget* createEditor() const;
virtual void valueToEditor();
virtual void valueFromEditor();
protected:
void init();
class CFontButtonEditor : public TButtonBasedEditor<QFontComboBox>
{
public:
CFontButtonEditor(QFontComboBox* fontComboEditor, CFontProperty* property);
protected:
virtual void onEditButtonActivated();
CFontProperty* m_property;
};
mutable QFont m_font;
QFontComboBox::FontFilters m_filters;
QFontDatabase::WritingSystem m_writeSystem;
mutable QFontComboBox m_fontCombo;
};
#endif // CFONTPROPERTY_H