7#if QT_DEPRECATED_SINCE(6
, 9
)
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
55
56
57
58
59
60
61
62
64QQuickLabsPlatformFontDialog::QQuickLabsPlatformFontDialog(QObject *parent)
65 : QQuickLabsPlatformDialog(QPlatformTheme::FontDialog, parent),
66 m_options(QFontDialogOptions::create())
71
72
73
74
75
76
77
78
79
80
81
82
83QFont QQuickLabsPlatformFontDialog::font()
const
88void QQuickLabsPlatformFontDialog::setFont(
const QFont &font)
99
100
101
102
103
104
105
106
107
108
109QFont QQuickLabsPlatformFontDialog::currentFont()
const
111 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(handle()))
112 return fontDialog->currentFont();
113 return m_currentFont;
116void QQuickLabsPlatformFontDialog::setCurrentFont(
const QFont &font)
118 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(handle()))
119 fontDialog->setCurrentFont(font);
120 m_currentFont = font;
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141QFontDialogOptions::FontDialogOptions QQuickLabsPlatformFontDialog::options()
const
143 return m_options->options();
146void QQuickLabsPlatformFontDialog::setOptions(QFontDialogOptions::FontDialogOptions options)
148 if (options == m_options->options())
151 m_options->setOptions(options);
152 emit optionsChanged();
155bool QQuickLabsPlatformFontDialog::useNativeDialog()
const
157 return QQuickLabsPlatformDialog::useNativeDialog()
158 && !m_options->testOption(QFontDialogOptions::DontUseNativeDialog);
161void QQuickLabsPlatformFontDialog::onCreate(QPlatformDialogHelper *dialog)
163 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(dialog)) {
164 connect(fontDialog, &QPlatformFontDialogHelper::currentFontChanged,
this, &QQuickLabsPlatformFontDialog::currentFontChanged);
165 fontDialog->setOptions(m_options);
169void QQuickLabsPlatformFontDialog::onShow(QPlatformDialogHelper *dialog)
171 m_options->setWindowTitle(title());
172 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(dialog))
173 fontDialog->setOptions(m_options);
176void QQuickLabsPlatformFontDialog::accept()
178 setFont(currentFont());
179 QQuickLabsPlatformDialog::accept();
184#include "moc_qquicklabsplatformfontdialog_p.cpp"