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
qquicklabsplatformfontdialog_p.h
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKLABSPLATFORMFONTDIALOG_P_H
6#define QQUICKLABSPLATFORMFONTDIALOG_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
20#include <QtGui/qfont.h>
21#include <QtQml/qqml.h>
22
23#if QT_DEPRECATED_SINCE(6, 9)
24
25QT_BEGIN_NAMESPACE
26
27class QQuickLabsPlatformFontDialog : public QQuickLabsPlatformDialog
28{
29 Q_OBJECT
30 QML_NAMED_ELEMENT(FontDialog)
31 QML_ADDED_IN_VERSION(1, 0)
32 QML_EXTENDED_NAMESPACE(QFontDialogOptions)
33 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
34 Q_PROPERTY(QFont currentFont READ currentFont WRITE setCurrentFont NOTIFY currentFontChanged FINAL)
35 Q_PROPERTY(QFontDialogOptions::FontDialogOptions options READ options WRITE setOptions NOTIFY optionsChanged FINAL)
36
37public:
38 explicit QQuickLabsPlatformFontDialog(QObject *parent = nullptr);
39
40 QFont font() const;
41 void setFont(const QFont &font);
42
43 QFont currentFont() const;
44 void setCurrentFont(const QFont &font);
45
46 QFontDialogOptions::FontDialogOptions options() const;
47 void setOptions(QFontDialogOptions::FontDialogOptions options);
48
49Q_SIGNALS:
50 void fontChanged();
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 void accept() override;
59
60private:
61 QFont m_font;
62 QFont m_currentFont; // TODO: QFontDialogOptions::initialFont
63 QSharedPointer<QFontDialogOptions> m_options;
64};
65
66QT_END_NAMESPACE
67
68#endif // QT_DEPRECATED_SINCE(6, 9)
69
70#endif // QQUICKLABSPLATFORMFONTDIALOG_P_H