Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickfontdialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKFONTDIALOG_P_H
6#define QQUICKFONTDIALOG_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/qfont.h>
20
22
24
25class Q_QUICKDIALOGS2_EXPORT QQuickFontDialog : public QQuickAbstractDialog
26{
27 Q_OBJECT
28 Q_PROPERTY(QFont selectedFont READ selectedFont WRITE setSelectedFont NOTIFY selectedFontChanged)
29 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged FINAL)
30 Q_PROPERTY(QFontDialogOptions::FontDialogOptions options READ options WRITE setOptions
31 RESET resetOptions NOTIFY optionsChanged)
32 QML_EXTENDED_NAMESPACE(QFontDialogOptions)
33 QML_NAMED_ELEMENT(FontDialog)
34 QML_ADDED_IN_VERSION(6, 2)
35
36public:
37 explicit QQuickFontDialog(QObject *parent = nullptr);
38
39 void setCurrentFont(const QFont &font);
40 QFont currentFont() const;
41
42 void setSelectedFont(const QFont &font);
43 QFont selectedFont() const;
44
45 QFontDialogOptions::FontDialogOptions options() const;
46 void setOptions(QFontDialogOptions::FontDialogOptions options);
47 void resetOptions();
48
49Q_SIGNALS:
50 void selectedFontChanged();
51 void currentFontChanged();
52 void optionsChanged();
53
54protected:
55 bool useNativeDialog() const override;
56 void onCreate(QPlatformDialogHelper *dialog) override;
57 void onShow(QPlatformDialogHelper *dialog) override;
58
59private:
60 QSharedPointer<QFontDialogOptions> m_options;
61 QFont m_selectedFont;
62};
63
64QT_END_NAMESPACE
65
66#endif // QQUICKFONTDIALOG_P_H