Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquicklabsplatformfontdialog.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
7
12
63
78{
79 return m_font;
80}
81
83{
84 if (m_font == font)
85 return;
86
87 m_font = font;
90}
91
104{
105 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(handle()))
106 return fontDialog->currentFont();
107 return m_currentFont;
108}
109
111{
112 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(handle()))
113 fontDialog->setCurrentFont(font);
114 m_currentFont = font;
115}
116
135QFontDialogOptions::FontDialogOptions QQuickLabsPlatformFontDialog::options() const
136{
137 return m_options->options();
138}
139
140void QQuickLabsPlatformFontDialog::setOptions(QFontDialogOptions::FontDialogOptions options)
141{
142 if (options == m_options->options())
143 return;
144
145 m_options->setOptions(options);
147}
148
154
156{
157 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(dialog)) {
159 fontDialog->setOptions(m_options);
160 }
161}
162
164{
165 m_options->setWindowTitle(title());
166 if (QPlatformFontDialogHelper *fontDialog = qobject_cast<QPlatformFontDialogHelper *>(dialog))
167 fontDialog->setOptions(m_options);
168}
169
175
177
178#include "moc_qquicklabsplatformfontdialog_p.cpp"
void setOptions(FontDialogOptions options)
void setWindowTitle(const QString &)
bool testOption(FontDialogOption option) const
FontDialogOptions options() const
\reentrant
Definition qfont.h:22
\inmodule QtCore
Definition qobject.h:103
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
Definition qobject.cpp:2960
The QPlatformDialogHelper class allows for platform-specific customization of dialogs.
The QPlatformFontDialogHelper class allows for platform-specific customization of font dialogs.
void currentFontChanged(const QFont &font)
The QPlatformTheme class allows customizing the UI based on themes.
QPlatformDialogHelper * handle() const
virtual void accept()
\qmlmethod void Qt.labs.platform::Dialog::accept()
void onShow(QPlatformDialogHelper *dialog) override
void accept() override
\qmlmethod void Qt.labs.platform::Dialog::accept()
void setOptions(QFontDialogOptions::FontDialogOptions options)
void onCreate(QPlatformDialogHelper *dialog) override
QFontDialogOptions::FontDialogOptions options
QQuickLabsPlatformFontDialog(QObject *parent=nullptr)
A native font dialog.
Combined button and popup list for selecting options.
SharedPointerFileDialogOptions m_options
#define emit
QFileDialog dialog(this)
[1]
view create()